File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+
2+ on :
3+ pull_request :
4+ types : [synchronize, opened, reopened, labeled]
5+
6+ permissions :
7+ pull-requests : write
8+
9+ jobs :
10+ multiple-labels :
11+ name : ' Check that only one validation label is applied'
12+ if : >
13+ ( (contains(github.event.pull_request.labels.*.name, 'run-full-validation') ? 1 : 0) +
14+ (contains(github.event.pull_request.labels.*.name, 'run-full-validation-long') ? 1 : 0) +
15+ (contains(github.event.pull_request.labels.*.name, 'run-quick-validation') ? 1 : 0)
16+ ) > 1
17+ runs-on : ubuntu-latest
18+ steps :
19+ - run : |
20+ echo "Multiple validation labels detected. Exiting."
21+ exit 1
22+
23+ validate :
24+ name : ' Validate Changed Packages - Github Hosted'
25+ runs-on : ubuntu-latest
26+
27+ steps :
28+
29+ - name : Run Validation Script
30+ run : |
31+ echo "Running validation because 'full validation' label was added"
32+ # Add your validation logic here (e.g., linting, testing)
33+
34+ sleep 30
35+ exit 0
36+
37+ - name : ' Remove label'
38+ run : |
39+ curl -X DELETE -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
40+ -H "Accept: application/vnd.github.v3+json" \
41+ "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels/run-full-validation"
42+
43+
You can’t perform that action at this time.
0 commit comments