File tree 2 files changed +15
-33
lines changed
2 files changed +15
-33
lines changed Original file line number Diff line number Diff line change 1
- const commitShaRegExp = / c o m m i t \/ (?< sha > \w { 40 } ) / gm ;
1
+ import { readFileSync } from 'node:fs' ;
2
2
3
- module . exports = async function run ( {
4
- github,
5
- context,
6
- version
7
- } ) {
8
- const {
9
- data : release
10
- } = await github . repos . getReleaseByTag ( {
11
- owner : context . repo . owner ,
12
- repo : context . repo . repo ,
13
- tag : `v${ version } `
14
- } ) ;
15
- release . url = release . html_url ;
3
+ export default async function run ( { github, context } ) {
4
+ const { version } = JSON . parse ( readFileSync ( new URL ( '../lerna.json' , import . meta. url ) ) . toString ( ) ) ;
16
5
17
- console . log ( release ) ;
18
- // const commits = [];
19
- // let result;
20
- // do {
21
- // result = commitShaRegExp.exec(release.body);
22
- // if (result && result.groups && result.groups.sha) {
23
- // commits.push({
24
- // hash: result.groups.sha
25
- // });
26
- // }
27
- // } while (result);
28
- } ;
6
+ const { data : release } = await github . request ( 'GET /repos/{owner}/{repo}/releases/tags/{tag}' , {
7
+ owner : context . repo . owner ,
8
+ repo : context . repo . repo ,
9
+ tag : `v${ version } `
10
+ } ) ;
11
+
12
+ console . log ( release ) ;
13
+ }
Original file line number Diff line number Diff line change @@ -19,14 +19,11 @@ jobs:
19
19
run : yarn --frozen-lockfile
20
20
21
21
- name : Add release comments to issues and PRs
22
- uses : actions/github-script@v6
22
+ uses : actions/github-script@v7
23
23
env :
24
24
GH_TOKEN : ${{ secrets.GH_TOKEN }}
25
25
with :
26
26
script : |
27
- const { readFileSync } = require('fs');
28
- const { URL } = require('url');
29
- const { version } = require('./lerna.json');
30
- console.log('Create issue comments for lerna version: ', version);
31
- const script = require('./.github/actions/createIssueComments.cjs');
32
- аwait script({ github: github.rest, context, core, version })
27
+ const { default: addIssueComments } = await import('${{ github.workspace }}/.github/createIssueComments.mjs');
28
+
29
+ await addIssueComments({ github, context })
You can’t perform that action at this time.
0 commit comments