Skip to content

Commit

Permalink
Add label if pre-commit passes (vllm-project#12527)
Browse files Browse the repository at this point in the history
Signed-off-by: Harry Mellor <[email protected]>
  • Loading branch information
hmellor authored Feb 13, 2025
1 parent d84cef7 commit bffddd9
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/add_label_precommit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Add label on pre-commit success
on:
workflow_run:
workflows: [pre-commit]
types: [requested, completed]
jobs:
add-label-on-pre-commit-success:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Add label
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['pre-commit-passed']
})
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
remove-label-on-pre-commit-not-success:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion != 'success' }}
steps:
- name: Remove label
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
github.rest.issues.removeLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['pre-commit passed']
})
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit bffddd9

Please sign in to comment.