-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add auto labeler for clippy (#3922)
Description --- Adds `workflow_run` trigger that adds/removes "clippy failed" label depending on "Clippy check" step Motivation and Context --- Easier to tell at a glance of the PR list if clippy has failed How Has This Been Tested? ---
- Loading branch information
Showing
2 changed files
with
72 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
on: | ||
workflow_run: | ||
workflows: | ||
- "Clippy check" | ||
types: | ||
- completed | ||
|
||
jobs: | ||
on-success: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
steps: | ||
- name: Download workflow artifact | ||
uses: dawidd6/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
workflow: CI | ||
run_id: ${{ github.event.workflow_run.id }} | ||
|
||
- name: Read PR number | ||
id: pr_num | ||
uses: juliangruber/[email protected] | ||
with: | ||
path: ./pr_num.txt | ||
|
||
- name: labeler | ||
uses: actions-ecosystem/action-remove-labels@v1 | ||
with: | ||
github_token: ${{ github.token }} | ||
labels: clippy failed | ||
number: ${{ steps.pr_num.output.content }} | ||
|
||
on-failure: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'failure' }} | ||
steps: | ||
- name: Download workflow artifact | ||
uses: dawidd6/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
workflow: CI | ||
run_id: ${{ github.event.workflow_run.id }} | ||
|
||
- name: Read PR number | ||
id: pr_num | ||
uses: juliangruber/[email protected] | ||
with: | ||
path: ./pr_num.txt | ||
|
||
- name: labeler | ||
uses: actions-ecosystem/action-add-labels@v1 | ||
with: | ||
github_token: ${{ github.token }} | ||
labels: clippy failed | ||
number: ${{ steps.pr_num.output.content }} |
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