Skip to content

Commit 2b646ce

Browse files
committed
wip
1 parent e5ea5fc commit 2b646ce

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/validate.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+

0 commit comments

Comments
 (0)