-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically label issues affecting cert-blocker jobs (infra) (#1570)
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
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|