mirror of
https://github.com/asterisk/asterisk.git
synced 2026-05-04 20:33:53 +00:00
.github: Replace PR workflows with stubs that call reusables
The PR workflows now are just stubs that call reusable
workflows located in the asterisk-ci-actions repo.
(cherry picked from commit b133383389)
This commit is contained in:
committed by
Asterisk Development Team
parent
0e0be7070b
commit
73c36d592e
59
.github/workflows/OnPRStateChanged.yml
vendored
Normal file
59
.github/workflows/OnPRStateChanged.yml
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
#
|
||||
# Workflows, like this one, that are triggered by PRs submitted
|
||||
# from forked repositories are severly limited in what they can do
|
||||
# for security reasons. For instance, they can't add or remove
|
||||
# labels or comments even on the PR that triggered them. Since
|
||||
# we need to both of those things, GitHub recommends creating a
|
||||
# separate workflow that does those tasks that's triggered when
|
||||
# this PR workflow starts or finishes. Since that workflow isn't
|
||||
# being run in the context of a forked repo, it has all the
|
||||
# privileges needed to add and remove labels and comments. The
|
||||
# accompanying OnPRStateChangedPriv workflow does just that.
|
||||
|
||||
name: PRStateChanged
|
||||
run-name: "PR ${{github.event.number}} ${{github.event.action}} by ${{ github.actor }}"
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, reopened, synchronize]
|
||||
|
||||
concurrency:
|
||||
group: ${{github.workflow}}-${{github.event.number}}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
#
|
||||
# Pull requests created from forked respositories don't have access
|
||||
# to the "Action Variables" ('vars' context) so we need to retrieve
|
||||
# control data from an action that's located in asterisk-ci-actions.
|
||||
#
|
||||
Setup:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
vars: ${{ steps.setvars.outputs.control_data }}
|
||||
steps:
|
||||
- id: setvars
|
||||
uses: asterisk/asterisk-ci-actions/GetRepoControlData@main
|
||||
with:
|
||||
repo: ${{ github.event.repository.name}}
|
||||
- name: DumpEnvironment
|
||||
uses: asterisk/asterisk-ci-actions/DumpEnvironmentAction@main
|
||||
with:
|
||||
action-vars: ${{ toJSON(steps.setvars.outputs) }}
|
||||
|
||||
PRCheck:
|
||||
name: PRCheck
|
||||
needs: Setup
|
||||
uses: asterisk/asterisk-ci-actions/.github/workflows/AsteriskUnitGateTest.yml@main
|
||||
with:
|
||||
test_type: prstatechange
|
||||
asterisk_repo: ${{github.repository}}
|
||||
pr_number: ${{github.event.number}}
|
||||
base_branch: ${{github.event.pull_request.base.ref}}
|
||||
build_options: ${{ fromJSON(needs.Setup.outputs.vars).BUILD_OPTIONS }}
|
||||
unittest_command: ${{ fromJSON(needs.Setup.outputs.vars).UNITTEST_COMMAND }}
|
||||
testsuite_repo: ${{ fromJSON(needs.Setup.outputs.vars).TESTSUITE_REPO }}
|
||||
gatetest_list: ${{ fromJSON(needs.Setup.outputs.vars).GATETEST_LIST }}
|
||||
gatetest_commands: ${{ fromJSON(needs.Setup.outputs.vars).GATETEST_COMMANDS }}
|
||||
secrets:
|
||||
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
Reference in New Issue
Block a user