Skip to content

Commit 86cfdec

Browse files
committed
create an issue on current node fail
1 parent 5f6cc28 commit 86cfdec

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

.github/workflows/nodejs.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- lts/-2
1717
- lts/-1
1818
- lts/*
19-
- latest
19+
- current
2020

2121
steps:
2222
- uses: actions/checkout@v3
@@ -33,9 +33,14 @@ jobs:
3333
- name: Test
3434
id: test
3535
run: npm test
36-
continue-on-error: ${{ matrix.node-version == 'latest' }}
37-
- name: Fail
38-
if: ${{ matrix.node-version == 'latest' && steps.test.outcome != 'success' }}
39-
run: |
40-
echo "Node.js ${{ matrix.node-version }} (${{ steps.version.outputs.node-version }}) failed"
41-
exit 0
36+
continue-on-error: ${{ matrix.node-version == 'current' }}
37+
- name: Create Issue on Fail
38+
if: ${{ matrix.node-version == 'current' && steps.test.outcome != 'success' }}
39+
uses: actions/github-script@v6
40+
with:
41+
script: |
42+
github.issues.create({
43+
owner: context.repo.owner,
44+
repo: context.repo.repo,
45+
title: 'Test failed on Node.js ${{ matrix.node-version }} (${{ steps.version.outputs.node-version }})',
46+
body: 'The test failed on Node.js ${{ steps.version.outputs.node-version }}, [possibly due to a new version being promoted to node@current](https://github.com/nodejs/release#release-schedule). See [Action run output](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more information.

0 commit comments

Comments
 (0)