Skip to content

Commit

Permalink
CHANGED: the way to get the modified files
Browse files Browse the repository at this point in the history
  • Loading branch information
AleixMT committed Apr 9, 2024
1 parent e489006 commit 86647e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/buildAndSendSignatures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,18 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}
# https://stackoverflow.com/questions/74265821/get-modified-files-in-github-actions
- name: Get changed files
id: changed-files
run: |
output=""
if ${{ github.event_name == 'pull_request' }}; then
echo "changed_files=$(git diff --name-only -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT
output="$(git diff --name-only -r HEAD^1 HEAD | xargs)"
else
echo "changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | xargs)" >> $GITHUB_OUTPUT
output="$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | xargs)"
fi
echo echo "changed_files=${output}" >> $GITHUB_OUTPUT
- name: List changed files
run: |
for file in ${{ steps.changed-files.outputs.changed_files }}; do
Expand Down
2 changes: 1 addition & 1 deletion templates/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,4 @@
</span>
</div>
</body>
</html>
</html>

0 comments on commit 86647e8

Please sign in to comment.