-
-
Notifications
You must be signed in to change notification settings - Fork 83
42 lines (40 loc) · 1.44 KB
/
repo-sync-preview.yml
File metadata and controls
42 lines (40 loc) · 1.44 KB
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
name: Repo-sync preview
on: # zizmor: ignore[dangerous-triggers]
workflow_run:
workflows: ["CI", "RuboCop", "CI lint"]
types: [completed]
branches:
- "ci/repo-sync-preview-*"
jobs:
report:
runs-on: ubuntu-latest
permissions: {}
if: >
github.event.workflow_run.event == 'push' &&
github.event.workflow_run.head_repository.fork == false
steps:
- name: Dispatch status to repo-sync
uses: actions/github-script@450193c5abd4cdb17ba9f3ffcfe8f635c4bb6c2a
with:
github-token: ${{ secrets.REPO_SYNC_DISPATCH_TOKEN }}
script: |
const { BRANCH, REPO, WORKFLOW, STATUS, RUN_URL } = process.env;
await github.rest.actions.createWorkflowDispatch({
owner: "hanakai-rb",
repo: "repo-sync",
workflow_id: "aggregate-preview-status.yml",
ref: "main",
inputs: {
pr_number: BRANCH.replace("ci/repo-sync-preview-", ""),
repo_name: REPO,
workflow_name: WORKFLOW,
status: STATUS,
run_url: RUN_URL
}
});
env:
BRANCH: ${{ github.event.workflow_run.head_branch }}
REPO: ${{ github.repository }}
WORKFLOW: ${{ github.event.workflow_run.name }}
STATUS: ${{ github.event.workflow_run.conclusion }}
RUN_URL: ${{ github.event.workflow_run.html_url }}