Skip to content

Test new composer lock diff workflow. #2

Test new composer lock diff workflow.

Test new composer lock diff workflow. #2

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' }}