1- name : Validate and Run Commands Based on PR Labels
1+ name : Trigger Tests on PR Comment
22
33on :
4- pull_request :
5- types : [opened, synchronize, labeled, unlabeled ]
4+ issue_comment :
5+ types : [created ]
66
77jobs :
8- validate-and-execute :
8+ quick_validation :
99 runs-on : ubuntu-latest
10-
10+ # if: |
11+ # github.event.issue.pull_request != null && contains(github.event.comment.body, '#quick-validation')
1112 steps :
1213 - name : Checkout code
13- uses : actions/checkout@v3
14-
15- # - name: Get PR Labels
16- # id: get-labels
17- # uses: actions/github-script@v6
18- # with:
19- # script: |
20- # const labels = context.payload.pull_request.labels.map(label => label.name);
21- # return labels;
22- # result-encoding: string
23-
24- # - name: Determine Validation Type
25- # id: determine-validation-mode
26- # run: |
27- # labels="${{ steps.get-labels.outputs.result }}"
28-
29- # validation_mode="thorough"
30- # if echo "$labels" | grep -q "quick validation"; then
31- # validation_mode="individual"
32- # fi
33-
34- # echo "validation_mode=$validation_mode" | tee -a $GITHUB_OUTPUT
35-
36- # # Validate source and trigger test, skipping if there are no deployable changes
37- # - name: 'If deployable changes were made, push source to a scratch org'
38- # run: |
39- # labels="${{ steps.get-labels.outputs.result }}"
40-
41- # validation_mode="thorough"
42- # if echo "$labels" | grep -q "quick validation"; then
43- # validation_mode="individual"
44- # fi
45- # echo $validation_mode
46-
47- - name : Get SFP Pool Validation Mode from the PR labels
48- id : sfp-validation-mode
49- uses : actions/github-script@v7
50- with :
51- script : |
52-
53- const labels = context.payload.pull_request.labels.map(label => label.name);
54- const hasQuickValidation = labels.includes('quick validation');
55- const hasFullValidation = labels.includes('full validation');
56-
57- let validationMode = 'thorough';
58-
59- if (hasQuickValidation && !hasFullValidation) {
60- validationMode = 'individual';
61- }
62-
63- console.log(`SFP Validation Mode: ${validationMode}`);
64- return validationMode;
65- result-encoding : string
14+ uses : actions/checkout@v2
6615
67- - name : Run Commands Based on the Validation Mode
16+ - name : Run Quick Validation Tests
6817 run : |
69- echo "Running commands based on the validation mode: ${{ steps.sfp-validation-mode.outputs.result }}"
18+ echo "Running Quick Validation Tests..."
19+ # Your quick validation test commands here
20+
21+ # full_validation:
22+ # runs-on: ubuntu-latest
23+ # if: |
24+ # github.event.issue.pull_request != null && contains(github.event.comment.body, '#full-validation')
25+ # steps:
26+ # - name: Checkout code
27+ # uses: actions/checkout@v2
28+
29+ # - name: Run Full Validation Tests
30+ # run: |
31+ # echo "Running Full Validation Tests..."
32+ # # Your full validation test commands here
0 commit comments