From 86647e8ae8eb1a2c723f4b3b008e63aab6b2245e Mon Sep 17 00:00:00 2001 From: AleixMT Date: Tue, 9 Apr 2024 20:36:11 +0200 Subject: [PATCH] CHANGED: the way to get the modified files --- .github/workflows/buildAndSendSignatures.yml | 8 ++++++-- templates/template.html | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/buildAndSendSignatures.yml b/.github/workflows/buildAndSendSignatures.yml index eb5b277..5f1fbdd 100644 --- a/.github/workflows/buildAndSendSignatures.yml +++ b/.github/workflows/buildAndSendSignatures.yml @@ -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 diff --git a/templates/template.html b/templates/template.html index 90071b1..2bb5240 100644 --- a/templates/template.html +++ b/templates/template.html @@ -172,4 +172,4 @@ - \ No newline at end of file +