File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-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') && contains(github.event.pull_request.labels.*.name, 'run-full-validation-long')) ||
14+ (contains(github.event.pull_request.labels.*.name, 'run-full-validation') && contains(github.event.pull_request.labels.*.name, 'run-quick-validation')) ||
15+ (contains(github.event.pull_request.labels.*.name, 'run-full-validation-long') && contains(github.event.pull_request.labels.*.name, 'run-quick-validation'))
16+ runs-on : ubuntu-latest
17+ steps :
18+ - run : |
19+ echo "Multiple validation labels detected. Exiting."
20+ exit 1
21+
22+ validate :
23+ name : ' Validate Changed Packages - Github Hosted'
24+ runs-on : ubuntu-latest
25+
26+ steps :
27+
28+ - name : Run Validation Script
29+ run : |
30+ echo "Running validation because 'full validation' label was added"
31+ # Add your validation logic here (e.g., linting, testing)
32+
33+ sleep 30
34+ exit 0
35+
36+ - name : ' Remove label'
37+ run : |
38+ curl -X DELETE -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
39+ -H "Accept: application/vnd.github.v3+json" \
40+ "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels/run-full-validation"
41+
42+
You can’t perform that action at this time.
0 commit comments