File tree 2 files changed +43
-7
lines changed
2 files changed +43
-7
lines changed Original file line number Diff line number Diff line change
1
+ name : Update pkg.pr.new comment
2
+
3
+ on :
4
+ workflow_run :
5
+ workflows : ['Publish to pkg.pr.new']
6
+ types :
7
+ - completed
8
+
9
+ jobs :
10
+ build :
11
+ if : github.repository == 'sveltejs/eslint-plugin-svelte'
12
+ name : ' Update comment'
13
+ runs-on : ubuntu-latest
14
+ steps :
15
+ - name : Download artifact
16
+ uses : actions/download-artifact@v4
17
+ with :
18
+ name : output
19
+ github-token : ${{ secrets.GITHUB_TOKEN }}
20
+ run-id : ${{ github.event.workflow_run.id }}
21
+ - run : ls -R .
22
+ - name : ' Post or update comment'
23
+ uses : actions/github-script@v6
24
+ with :
25
+ github-token : ${{ secrets.GITHUB_TOKEN }}
26
+ script : |
27
+ const fs = require('fs');
28
+ const output = JSON.parse(fs.readFileSync('output.json', 'utf8'));
29
+ const { default: process } = await import('${{ github.workspace }}/tools/pkg.pr.new-comment.mjs')
30
+
31
+ await process({github, context, core, output})
Original file line number Diff line number Diff line change 6
6
branches : [main]
7
7
tags : ['!**']
8
8
9
- permissions :
10
- issues : write
11
- pull-requests : write
12
-
13
9
jobs :
14
10
build :
15
11
if : github.repository == 'sveltejs/eslint-plugin-svelte'
@@ -24,12 +20,21 @@ jobs:
24
20
- name : Build
25
21
run : pnpm run build
26
22
- run : pnpx pkg-pr-new publish --compact './packages/eslint-plugin-svelte' --json output.json --comment=off
27
- - uses : actions/github-script@v7
23
+ - name : Add metadata to output
24
+ uses : actions/github-script@v7
28
25
with :
29
26
github-token : ${{ secrets.GITHUB_TOKEN }}
30
27
script : |
31
28
const fs = require('fs');
32
29
const output = JSON.parse(fs.readFileSync('output.json', 'utf8'));
33
- const { default: process } = await import('${{ github.workspace }}/tools/pkg.pr.new-comment.mjs')
30
+ output.number = context.issue.number;
31
+ output.event_name = context.eventName;
32
+ output.ref = context.ref;
33
+ fs.writeFileSync('output.json', JSON.stringify(output), 'utf8');
34
+ - name : Upload output
35
+ uses : actions/upload-artifact@v4
36
+ with :
37
+ name : output
38
+ path : ./output.json
34
39
35
- await process({github, context, core, output})
40
+ - run : ls -R .
You can’t perform that action at this time.
0 commit comments