Skip to content

Commit c8cf46e

Browse files
committed
feat: dispatch validation with low stats for PRs or high stats for PR merges
1 parent 46a4efb commit c8cf46e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/validation.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ concurrency:
1010
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1111
cancel-in-progress: true
1212

13+
env:
14+
# number of events; use 0 for the default in `clas12-validation`
15+
num_events_low_stats: 0
16+
num_events_high_stats: 10000
17+
1318
jobs:
1419

1520
clas12-validation:
@@ -20,6 +25,12 @@ jobs:
2025
- name: sanitize message
2126
id: sanitize
2227
run: echo title=$(echo '${{ github.event.pull_request.title || github.event.head_commit.message }}' | head -n1 | sed 's;";;g' | sed "s;';;g") >> $GITHUB_OUTPUT
28+
- name: set number of events
29+
id: num_events
30+
run: |
31+
# use low stats for PR commits, or high stats for pushes (which should only be PR merges)
32+
[ "${{ github.event_name }}" = "push" ] && num_events=${{ env.num_events_high_stats }} || num_events=${{ env.num_events_low_stats }}
33+
echo num_events=$num_events >> $GITHUB_OUTPUT
2334
- name: dispatch
2435
uses: c-dilks/trigger-workflow-and-wait@master # convictional/[email protected]
2536
with:
@@ -31,6 +42,7 @@ jobs:
3142
ref: main
3243
client_payload: >-
3344
{
45+
"num_events": "${{ steps.num_events.outputs.num_events }}",
3446
"actor": "${{ github.actor }}",
3547
"source": "${{ github.event.repository.name }}",
3648
"title": "${{ steps.sanitize.outputs.title }}",

0 commit comments

Comments
 (0)