Skip to content

Commit e6559a7

Browse files
committed
Add support for labeled (run validation) pull request events and remove validation label if present
1 parent 274f1ea commit e6559a7

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

.github/workflows/validate-pull-request.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Validate Pull Request
22

33
on:
44
pull_request:
5-
types: [opened, synchronize, reopened]
5+
types: [opened, synchronize, reopened, labeled]
66

77
permissions:
88
contents: read
@@ -12,8 +12,22 @@ permissions:
1212
jobs:
1313
validate-metadata:
1414
runs-on: ubuntu-latest
15+
if: github.event.action != 'labeled' || github.event.label.name == 'run validation'
1516

1617
steps:
18+
- name: Remove validation label if present
19+
if: github.event.action == 'labeled' && github.event.label.name == 'run validation'
20+
uses: actions/github-script@v7
21+
with:
22+
github-token: ${{ secrets.GITHUB_TOKEN }}
23+
script: |
24+
github.rest.issues.removeLabel({
25+
owner: context.repo.owner,
26+
repo: context.repo.repo,
27+
issue_number: context.issue.number,
28+
name: 'run validation'
29+
})
30+
1731
- name: Checkout code
1832
uses: actions/checkout@v4
1933
with:

0 commit comments

Comments
 (0)