-
Notifications
You must be signed in to change notification settings - Fork 395
40 lines (39 loc) · 1.18 KB
/
push-dispatch.yaml
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
name: Push dispatch
on:
push:
branches:
- main
jobs:
changed-build:
runs-on: ubuntu-latest
name: Get changed builds
outputs:
changed-build: ${{ steps.changed-build.outputs.all_changed_files }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changed builds
id: changed-build
uses: tj-actions/[email protected]
with:
files: |
Jenkins/Dockerfile*
- name: List changed builds
run: |
for file in ${{ steps.changed-build.outputs.all_changed_files }}; do
echo "$file was changed"
done
dispatch:
if: ${{ needs.changed-build.outputs.changed-build }}
runs-on: ubuntu-latest
name: Dispatch payload
needs: changed-build
steps:
- name: Repository dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.GH_PAT }}
repository: ${{ secrets.DISPATCH_REPO }}
event-type: push-dispatch
client-payload: '{"repo_name": "${{ github.repository }}", "ref": "${{ github.ref }}", "changed-build": "${{ needs.changed-build.outputs.changed-build}}"}'