Skip to content

Queue tmp-tests (pull_request) #29

Queue tmp-tests (pull_request)

Queue tmp-tests (pull_request) #29

Workflow file for this run

name: Regression Suite Entry Point CI/CD
run-name : Queue ${{ github.event_name == 'push' && 'CI' || github.event.label.name }} (${{ github.event_name }})
on:
push:
branches: [ master, develop ]
# See https://stackoverflow.com/a/78444521 and
# https://github.com/orgs/community/discussions/26874#discussioncomment-3253755
# as well as official (but buried) documentation :
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull-request-events-for-forked-repositories-2
pull_request:
types: [ labeled ]
# https://docs.github.com/en/actions/sharing-automations/reusing-workflows#supported-keywords-for-jobs-that-call-a-reusable-workflow
# Also https://stackoverflow.com/a/74959635
# TL;DR - For public repositories the safest approach will be to use the default read permissions, but at the cost
# of not being able to modify the labels. That will need to be a separate [trusted] workflow that runs from the base repo
# permissions :
# contents : read
# pull-requests : write
# Write our tests out this way for easier legibility
# testsSet :
# - key : value
# key : value
# tests :
# - value
# - value
# - < next test >
# https://stackoverflow.com/a/68940067
jobs:
queue_tests:
if : ${{ contains( fromJson('["compile-tests","all-tests","tmp-tests"]'), github.event.label.name ) || github.event_name == 'push' }}
name: Queue Test (${{ github.event_name == 'push' && github.ref_name || github.event.label.name }})
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Test
run : |
echo "Hello World!"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ github.token }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/workflows/ci.yml/dispatches \
-d '{"ref":"${{ github.head_ref }}","inputs":{"event_name":"${{ github.event_name }}", "event_number" : "${{ github.event.number }}", "test":"${{ github.event.label.name }}", "ref":"${{ github.ref }}"}}'