Skip to content

Commit f0e8e79

Browse files
committed
GHA: Closed issue/PR comment-lock test
This commit limits the blast-radius should the workflow fail catastrophically. It also instruments the workflow with a job-level test-failure to trigger a notification mail. This commit should be reverted once the workflow is deemed functional. Signed-off-by: Chris Evich <[email protected]>
1 parent 5477fd3 commit f0e8e79

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/discussion_lock.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ env:
3232
# Number of days befor a closed issue/PR is be comment-locked.
3333
# Note: dessant/lock-threads will only process a max. of
3434
# 50 issues/PRs at a time.
35-
CLOSED_DAYS: 90
35+
CLOSED_DAYS: 1825
3636
# Pre-created issue/PR label to add (preferrably a bright color).
3737
# This is intended to direct a would-be commenter's actions.
3838
LOCKED_LABEL: 'locked - please file new issue/PR'
@@ -54,6 +54,10 @@ jobs:
5454
add-pr-labels: '${{env.LOCKED_LABEL}}'
5555
pr-lock-reason: 'resolved'
5656
log-output: true
57+
# Test the failure-notification step functions on failure
58+
- run: |
59+
echo "::warning::Initiating job test-failure to prompt a human to verify this is working and some issues/PRs were locked."
60+
false
5761
- if: failure()
5862
name: Send job failure notification e-mail
5963
uses: dawidd6/[email protected]
@@ -65,4 +69,7 @@ jobs:
6569
subject: Github workflow error on ${{github.repository}}
6670
6771
from: ${{secrets.ACTION_MAIL_SENDER}}
68-
body: "Job failed: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
72+
body: |
73+
Job test-failed - https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
74+
75+
Please verify some issues/PRs were locked, then revert the commit which added this check.

0 commit comments

Comments
 (0)