Skip to content

Commit

Permalink
add changed_file check
Browse files Browse the repository at this point in the history
  • Loading branch information
gdams committed Oct 10, 2024
1 parent a58f829 commit 3029e29
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build_test_containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@ jobs:
id: get_changed_files
run: |
if [ ${{ github.event_name }} == "push" ]; then
changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep ansible/docker/test/Dockerfile)
changed_files=$(git diff --name-only HEAD~1 | grep -v ansible/docker/test/Dockerfile)
else
changed_files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep ansible/docker/test/Dockerfile)
changed_files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep -v ansible/docker/test/Dockerfile)
fi
echo "changed_files=$changed_files" >> "$GITHUB_ENV"
# Generate matrix
- name: Generate matrix
if: steps.get_changed_files.outputs.changed_files
id: generate_matrix
run: |
matrix=$(jq -n --arg files "${changed_files}" '{
Expand Down

0 comments on commit 3029e29

Please sign in to comment.