|
1 | 1 | name: Repo-sync preview |
2 | 2 |
|
3 | | -on: |
| 3 | +on: # zizmor: ignore[dangerous-triggers] |
4 | 4 | workflow_run: |
5 | 5 | workflows: ["CI", "RuboCop"] |
6 | 6 | types: [completed] |
|
10 | 10 | jobs: |
11 | 11 | report: |
12 | 12 | runs-on: ubuntu-latest |
| 13 | + permissions: {} |
| 14 | + if: > |
| 15 | + github.event.workflow_run.event == 'push' && |
| 16 | + github.event.workflow_run.head_repository.fork == false |
13 | 17 | steps: |
14 | 18 | - name: Dispatch status to repo-sync |
15 | | - uses: actions/github-script@v7 |
| 19 | + uses: actions/github-script@450193c5abd4cdb17ba9f3ffcfe8f635c4bb6c2a |
16 | 20 | with: |
17 | 21 | github-token: ${{ secrets.REPO_SYNC_DISPATCH_TOKEN }} |
18 | 22 | script: | |
| 23 | + const { BRANCH, REPO, WORKFLOW, STATUS, RUN_URL } = process.env; |
19 | 24 | await github.rest.actions.createWorkflowDispatch({ |
20 | 25 | owner: "hanakai-rb", |
21 | 26 | repo: "repo-sync", |
22 | 27 | workflow_id: "aggregate-preview-status.yml", |
23 | 28 | ref: "main", |
24 | 29 | inputs: { |
25 | | - pr_number: "${{ github.event.workflow_run.head_branch }}".replace("ci/repo-sync-preview-", ""), |
26 | | - repo_name: "${{ github.repository }}", |
27 | | - workflow_name: "${{ github.event.workflow_run.name }}", |
28 | | - status: "${{ github.event.workflow_run.conclusion }}", |
29 | | - run_url: "${{ github.event.workflow_run.html_url }}" |
| 30 | + pr_number: BRANCH.replace("ci/repo-sync-preview-", ""), |
| 31 | + repo_name: REPO, |
| 32 | + workflow_name: WORKFLOW, |
| 33 | + status: STATUS, |
| 34 | + run_url: RUN_URL |
30 | 35 | } |
31 | 36 | }); |
| 37 | + env: |
| 38 | + BRANCH: ${{ github.event.workflow_run.head_branch }} |
| 39 | + REPO: ${{ github.repository }} |
| 40 | + WORKFLOW: ${{ github.event.workflow_run.name }} |
| 41 | + STATUS: ${{ github.event.workflow_run.conclusion }} |
| 42 | + RUN_URL: ${{ github.event.workflow_run.html_url }} |
0 commit comments