Test new composer lock diff workflow. #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Composer Lock Diff" | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
Composer-Lock-Diff: | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: read | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Check if composer.lock was changed | |
id: composer-lock-changed | |
uses: tj-actions/changed-files@v44 | |
with: | |
files: 'composer.lock' | |
- name: Delete sticky pull request comment | |
uses: marocchino/sticky-pull-request-comment@v2 | |
with: | |
header: composer-lock-diff | |
delete: true | |
- uses: actions/cache@v4 | |
if: ${{ steps.composer-lock-changed.outputs.any_changed == 'true' }} | |
with: | |
path: ${{ github.workspace }}/.ddev/.drainpipe-composer-cache | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Generate composer diff | |
if: ${{ steps.composer-lock-changed.outputs.any_changed == 'true' }} | |
id: composer-diff | |
uses: IonBazan/composer-diff-action@v1 | |
with: | |
with-platform: true | |
with-links: true | |
- name: Post sticky pull request comment | |
if: ${{ steps.composer-lock-changed.outputs.any_changed == 'true' }} | |
uses: marocchino/sticky-pull-request-comment@v2 | |
with: | |
header: composer-lock-diff | |
message: | | |
### Composer package changes | |
${{ (steps.composer-diff.outcome != 'success' && 'Review any changes to composer.lock manually.') || steps.composer-diff.outputs.composer_diff || 'No changes found' }} |