Skip to content

Commit f2c0c45

Browse files
bjohansebasctcpip
andauthored
ci: add error handling to create issues on upstream check failure (#34)
Co-authored-by: Chris de Almeida <[email protected]>
1 parent 2740734 commit f2c0c45

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/upstream.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77

88
permissions:
99
contents: read
10+
issues: write # to create issues if the upstream check fails
1011

1112
jobs:
1213
test:
@@ -23,3 +24,19 @@ jobs:
2324
node-version: ${{ matrix.node-version }}
2425
- run: npm install
2526
- run: npm run upstream
27+
- name: Handle error
28+
if: ${{ failure() }}
29+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
30+
with:
31+
script: |
32+
const { owner, repo } = context.repo;
33+
const nodeVersion = process.version;
34+
const issueTitle = `Upstream check failed`;
35+
const issueBody = `Node ${nodeVersion} has made changes to the functions this module depends on. Please review the new function changes, determine if this module requires changes because of them, and update the function hashes. Add a comment below with your findings.`;
36+
37+
const issue = await github.rest.issues.create({
38+
owner,
39+
repo,
40+
title: issueTitle,
41+
body: issueBody,
42+
});

0 commit comments

Comments
 (0)