Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .github/workflows/check_diff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
check:
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.check.outputs.changed }}
changed: ${{ steps.check-pr.outputs.changed || steps.check-push.outputs.changed }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -25,12 +25,24 @@ jobs:
submodules: recursive
token: ${{ secrets.GITHUB_TOKEN }}

- name: Check for changes
id: check
- name: Check for changes (Pull Request)
if: github.event_name == 'pull_request'
id: check-pr
run: |
FILES_CHANGED=$(git diff --name-only ${{ github.event.pull_request.base.sha }} HEAD)
if echo "$FILES_CHANGED" | grep -m 1 "${{ inputs.pattern }}"; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi

- name: Check for changes (Push)
if: github.event_name == 'push'
id: check-push
run: |
FILES_CHANGED=$(git diff --name-only HEAD^ HEAD)
if echo "$FILES_CHANGED" | grep -m 1 "${{ inputs.pattern }}"; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi