Skip to content

Maybe fix npm diff

Maybe fix npm diff #30

name: Composer and NPM Package Diff
on:
pull_request:
paths:
- 'composer.lock'
- 'package-lock.json'
- '.github/workflows/composer-npm-diff.yml'
permissions:
contents: write
pull-requests: write
jobs:
composer-diff:
name: Composer Diff
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate composer diff
id: composer_diff
uses: IonBazan/composer-diff-action@v1
- uses: marocchino/sticky-pull-request-comment@v2
if: ${{ steps.composer_diff.outputs.composer_diff_exit_code != 0 }}
with:
header: composer-diff
message: |
<strong>Composer Changes</strong>
${{ steps.composer_diff.outputs.composer_diff }}
npm-diff:
name: NPM Lockfile Diff
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Compile NPM packages
run: npm ci
- name: Set the Issue number for npm-lockfile-changes
id: set-issue-number-env
uses: actions/github-script@v6
with:
script: |
const issue_number = context.payload.pull_request.number;
core.exportVariable('GITHUB_ISSUE_NUMBER', issue_number);
# - name: Debug
# run: |
# echo "${{ toJson(github) }}" > github_context.json
# jq . github_context.json
- name: NPM Lockfile Changes
uses: codepunkt/npm-lockfile-changes@main
with:
token: ${{ github.token }}