Skip to content

Commit

Permalink
Automatically label issues affecting cert-blocker jobs (infra) (#1570)
Browse files Browse the repository at this point in the history
Automatically label issues affecting cert-blocker jobs

Add a checkbox (no pun intended) in the issue template so that reporter
can mention whether or not this is about a cert-blocker test case.

Add a GitHub Action to automatically label the issue if this is checked.
  • Loading branch information
pieqq authored Nov 1, 2024
1 parent e17ae01 commit 781a1c8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ body:
If applicable, add screenshots to help explain the problem you are facing.
validations:
required: true
- type: checkboxes
attributes:
label: Cert-blocker Test Case
options:
- label: This issue is about a test case that has the "blocker" certification status
- type: textarea
id: reproduction
attributes:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/label-cert-blocker-issue.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Label issue related to cert-blocker test cases

on:
issues:
types: [opened]

jobs:
label_checked_item:
runs-on: ubuntu-latest
permissions:
issues: write

steps:
- name: Check if an issue has a ticked cert-blocker test case mark
id: check_for_cert_blocker_test_case
run: |
if echo "${{ github.event.issue.body }}" | grep -q "\[x\] Cert-blocker Test Case"; then
echo "found=true" >> $GITHUB_ENV
else
echo "found=false" >> $GITHUB_ENV
fi
- name: Add label if cert-blocker test case mark found
if: env.found == 'true'
run: gh issue edit "$NUMBER" --add-label "$LABELS"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
LABELS: cert-blocker test case

0 comments on commit 781a1c8

Please sign in to comment.