-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yaml
More file actions
134 lines (124 loc) · 4.8 KB
/
action.yaml
File metadata and controls
134 lines (124 loc) · 4.8 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: 'ecosystem_ci_per_commit'
description: 'Trigger downstream ecosystem CI for commits and comment on failures'
inputs:
github-token:
description: 'Token with access to the downstream ecosystem CI repository'
required: true
ecosystem-owner:
description: 'Owner of the downstream ecosystem CI repository'
required: false
default: 'rstackjs'
ecosystem-repo:
description: 'Repository containing the downstream workflow'
required: true
workflow-file:
description: 'Workflow file to execute in the downstream repository'
required: true
client-payload:
description: 'JSON payload passed to the downstream workflow dispatch'
required: false
default: '{}'
job-name-prefix:
description: 'Job name prefix to match when summarizing downstream jobs'
required: false
default: 'execute-all '
outputs:
workflow-id:
description: 'ID of the triggered downstream workflow run'
value: ${{ steps.eco_ci.outputs.workflow_id }}
workflow-url:
description: 'URL of the triggered downstream workflow run'
value: ${{ steps.eco_ci.outputs.workflow_url }}
conclusion:
description: 'Conclusion reported by the downstream workflow'
value: ${{ steps.eco_ci.outputs.conclusion }}
summary:
description: 'Formatted markdown summary of downstream job results'
value: ${{ steps.eco-ci-result.outputs.summary }}
results:
description: 'JSON payload describing downstream workflow run and suites'
value: ${{ steps.eco-ci-result.outputs.results }}
runs:
using: composite
steps:
- name: Run Ecosystem CI with notify
id: eco_ci
continue-on-error: true
uses: convictional/trigger-workflow-and-wait@f69fa9eedd3c62a599220f4d5745230e237904be # v1.6.5
with:
owner: rstackjs
repo: rstack-ecosystem-ci
workflow_file_name: ${{ inputs.workflow-file }}
github_token: ${{ inputs.github-token }}
ref: 'main'
client_payload: ${{ inputs.client-payload }}
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
# checkout@v6 persists credentials via includeIf gitdir, which leaks
# GITHUB_TOKEN auth into the worktree later created by
# JamesIves/github-pages-deploy-action and overrides the PAT in `token`,
# causing 403 on cross-repo push.
# See https://github.com/JamesIves/github-pages-deploy-action/issues/1928
persist-credentials: false
- name: Setup Node.js
if: steps.eco_ci.outcome == 'failure'
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: 22
package-manager-cache: false
- name: Get CI Result
id: eco-ci-result
uses: rstackjs/rstack-ecosystem-ci/.github/actions/ecosystem-ci-result@main
with:
job-prefix: ${{ inputs.job-name-prefix }}
heading: ${{ inputs.ecosystem-repo }}
workflow-output: ${{ toJson(steps.eco_ci.outputs) }}
- id: create-commit-comment
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
if: steps.eco_ci.outcome == 'failure'
name: Create Commit Comment
env:
SUMMARY: ${{ steps.eco-ci-result.outputs.summary }}
with:
script: |
await github.rest.repos.createCommitComment({
commit_sha: context.sha,
owner: '${{ inputs.ecosystem-owner }}',
repo: '${{ inputs.ecosystem-repo }}',
body: process.env.SUMMARY
})
- name: Checkout ecosystem-ci repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: rstackjs/rstack-ecosystem-ci
ref: main
path: ecosystem-ci-repo
fetch-depth: 1
persist-credentials: false
- name: Update Ecosystem History
id: update-history
shell: bash
env:
CLIENT_PAYLOAD: ${{ inputs.client-payload }}
SUMMARY_MARKDOWN: ${{ steps.eco-ci-result.outputs.summary }}
RESULTS_JSON: ${{ steps.eco-ci-result.outputs.results }}
WORKFLOW_FILE: ${{ inputs.workflow-file }}
HISTORY_REPOSITORY: rstackjs/rstack-ecosystem-ci
OUTPUT_DIR: data-artifacts
GITHUB_TOKEN: ${{ inputs.github-token }}
run: |
node "$GITHUB_WORKSPACE/ecosystem-ci-repo/scripts/update-ecosystem-history.mjs"
- name: Publish History
if: ${{ steps.update-history.outcome == 'success' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: data
folder: data-artifacts
clean: false
target-folder: .
token: ${{ inputs.github-token }}
repository-name: rstackjs/rstack-ecosystem-ci
git-config-name: github-actions[bot]
git-config-email: github-actions[bot]@users.noreply.github.com