-
Notifications
You must be signed in to change notification settings - Fork 222
32 lines (32 loc) · 986 Bytes
/
push.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
name: Push Downstream
on:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
push-downstream:
timeout-minutes: 5
runs-on: ubuntu-20.04
steps:
- uses: actions/github-script@v7
env:
ACTOR: ${{ github.actor }}
MESSAGE: ${{ github.event.head_commit.message }}
SHA: ${{ github.sha }}
with:
github-token: ${{ secrets.DOWNSTREAM_TOKEN }}
script: |
const { ACTOR, MESSAGE, SHA } = process.env;
const result = await github.rest.actions.createWorkflowDispatch({
owner: '${{ secrets.DOWNSTREAM_OWNER }}',
repo: '${{ secrets.DOWNSTREAM_REPO }}',
workflow_id: '${{ secrets.DOWNSTREAM_WORKFLOW_ID }}',
ref: 'main',
inputs: {
sha: SHA,
actor: ACTOR,
message: MESSAGE
}
});