Skip to content

Commit 4575bf8

Browse files
committed
build: show CI results on PR
1 parent e7864e6 commit 4575bf8

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

.github/workflows/on-ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Webhook workflow
2+
3+
on:
4+
repository_dispatch:
5+
types: [ci-complete]
6+
7+
env:
8+
NODE_VERSION: lts/*
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Install Node.js
16+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
17+
with:
18+
node-version: ${{ env.NODE_VERSION }}
19+
20+
- name: Install @node-core/utils
21+
run: npm install -g @node-core/utils
22+
23+
- name: Setup @node-core/utils
24+
run: |
25+
ncu-config set username "$USERNAME"
26+
ncu-config set token "$GH_TOKEN"
27+
ncu-config set jenkins_token "$JENKINS_TOKEN"
28+
ncu-config set owner "$GITHUB_REPOSITORY_OWNER"
29+
ncu-config set repo "$(echo "$GITHUB_REPOSITORY" | cut -d/ -f2)"
30+
env:
31+
USERNAME: ${{ secrets.JENKINS_USER }}
32+
GH_TOKEN: ${{ secrets.GH_USER_TOKEN }}
33+
JENKINS_TOKEN: ${{ secrets.JENKINS_TOKEN }}
34+
35+
- name: Start the CI
36+
run: |
37+
curl -fsSL "https://github.com/${GITHUB_REPOSITORY}/raw/${GITHUB_SHA}/tools/actions/ci-status.sh" \
38+
| sh
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
GITHUB_PR_NUMBER: ${{ github.event.client_payload.pr }}
42+
JENKINS_JOB_ID: ${{ github.event.client_payload.id }}
43+
GH_REPO: ${{ github.repository }}

tools/actions/ci-status.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ncu-ci pr ${JENKINS_JOB_ID} --markdown output.md
2+
gh pr comment ${GITHUB_PR_NUMBER} --body-file output.md

0 commit comments

Comments
 (0)