Skip to content

Commit

Permalink
💚 Update automation_workflow.yml to check for changes in package.json…
Browse files Browse the repository at this point in the history
… and CHANGELOG.md
  • Loading branch information
Aboudjem committed Feb 18, 2024
1 parent 7cb6932 commit 5217da1
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/automation_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@ jobs:
runs-on: ubuntu-latest
if: contains(github.head_ref, 'fix/') || contains(github.head_ref, 'release/')
steps:
- uses: actions/checkout@v2
- name: Check for versioning changes in package.json and CHANGELOG.md
run: |
git fetch --depth=1 origin +refs/heads/*:refs/remotes/origin/*
PACKAGE_CHANGED=$(git diff --name-only origin/${{ github.base_ref }}...${{ github.sha }} -- 'package.json')
CHANGELOG_CHANGED=$(git diff --name-only origin/${{ github.base_ref }}...${{ github.sha }} -- 'CHANGELOG.md')
if [[ -z "$PACKAGE_CHANGED" || -z "$CHANGELOG_CHANGED" ]]; then
echo "::error::package.json and CHANGELOG.md must be updated."
exit 1
fi
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
package:
- 'package.json'
changelog:
- 'CHANGELOG.md'
- name: Fail if package.json or CHANGELOG.md are not updated
if: ${{ !steps.changes.outputs.package && !steps.changes.outputs.changelog }}
run: |
echo "package.json and CHANGELOG.md must be updated in this PR."
exit 1
auto-create-pr-to-dev-main:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 5217da1

Please sign in to comment.