We have a project where the composer.lock file is situated in a subfolder (packages/backend/
).
I tried to set the target
parameter to configure this, but I can't seem to find the correct one.
This is the last one I tried:
name: Composer Diff
on:
pull_request:
paths:
- 'packages/backend/composer.lock'
jobs:
composer-diff:
name: Composer Diff
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to make it possible to compare with PR base branch
- name: Generate composer diff
id: composer_diff # To reference the output in comment
uses: IonBazan/composer-diff-action@v1
with:
target: ${{ github.event.pull_request.base.sha }}:packages/backend/composer.lock
- uses: marocchino/sticky-pull-request-comment@v2
# An empty diff result will break this action.
if: ${{ steps.composer_diff.outputs.composer_diff_exit_code != 0 }}
with:
target: ${{ github.event.pull_request.base.sha }}:packages/backend/composer.lock
header: composer-diff # Creates a collapsed comment with the report
message: |
<details>
<summary>Composer package changes</summary>
${{ steps.composer_diff.outputs.composer_diff }}
</details>
In the "Generate composer diff" step we receive the error Could not open file 2a6af2d592e1f11b0d4e535bb096133d62096101 or find it in git as 2a6af2d592e1f11b0d4e535bb096133d62096101:composer.lock: fatal: path 'composer.lock' does not exist in '2a6af2d592e1f11b0d4e535bb096133d62096101
In the "Run marocchino/sticky-pull-request-comment@v2" step we receive the warning Unexpected input(s) 'target', valid inputs are ['header', 'append', 'recreate', 'delete', 'only_create', 'only_update', 'hide_details', 'hide', 'hide_and_recreate', 'hide_classify', 'message', 'path', 'ignore_empty', 'skip_unchanged', 'follow_symbolic_links', 'number', 'owner', 'repo', 'GITHUB_TOKEN']
.
These two errors tell me that the target keys in the config are at the wrong place. Could someone point us in the right direction here?