-
Notifications
You must be signed in to change notification settings - Fork 46
48 lines (47 loc) · 1.65 KB
/
dispatcher.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: CI/CD
on:
push:
# Disables the branch builds for some branches,
# the dispatcher for PRs should get triggered anyway
branches-ignore:
# Dependabot branch builds disabled as they do not access secrets
- 'dependabot/**'
paths-ignore:
- '.gitignore'
- '.mergify.yml'
- 'CHANGELOG.md'
- 'LICENSE'
- 'README.md'
- 'renovate.json'
pull_request:
workflow_dispatch:
jobs:
inspect:
runs-on: ubuntu-latest
if: false
steps:
- run: |
echo 'github.event_name = ${{ github.event_name }}'
echo 'github.event.pull_request.head.repo.full_name = ${{ github.event.pull_request.head.repo.full_name }}'
echo 'github.repository = ${{ github.repository }}'
echo 'github.head_ref = ${{ github.head_ref }}'
dispatcher:
runs-on: ubuntu-latest
# This filter blocks all pull-request builds that also have a branch build.
# Called workflows inherit the event, so, internally the workflow can distinguish.
# If the event is not a pull request, then the build should run
# (it is either a branch push or a dispatched workflow).
# If the pull request comes from another repo, then the build should run.
# If the pull request is from a dependabot branch, it should run, as
# the dispatcher is disabled for dependabot branch builds.
if: >-
github.event_name != 'pull_request'
|| github.event.pull_request.head.repo.full_name != github.repository
|| startsWith(github.head_ref, 'dependabot/')
steps:
- run: 'true'
ci-cd:
needs:
- dispatcher
uses: ./.github/workflows/build-and-deploy.yml
secrets: inherit