Skip to content

Commit fa3b0a4

Browse files
committed
gha: update or add PR comment on existing PR
1 parent 0e5c925 commit fa3b0a4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/lockfiles.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ jobs:
357357
done
358358
359359
- name: Prepare PR comment
360+
env:
361+
RUN_LINK: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
360362
run: |
361363
echo "# Lockfile Diffs" > ${PR_COMMENT}
362364
echo >> ${PR_COMMENT}
@@ -371,6 +373,7 @@ jobs:
371373
echo >> ${PR_COMMENT}
372374
fi
373375
done
376+
echo ":robot: [GitHub Actions Workflow Run](${RUN_LINK})" >> ${PR_COMMENT}
374377
375378
- name: Commit and push
376379
run: |
@@ -388,3 +391,12 @@ jobs:
388391
--assignee "${{ github.event.sender.login }}"
389392
--label "external dependency"
390393
--label "python3"
394+
395+
# TODO This updates an existing comment. Should it just add a new comment on re-run?
396+
- name: Comment on existing PR
397+
if: ${{ inputs.pr != 'new' }}
398+
run: >
399+
gh pr comment ${{ inputs.pr }}
400+
--body-file "${PR_COMMENT}"
401+
--edit-last
402+
--create-if-none

0 commit comments

Comments
 (0)