File tree 2 files changed +23
-10
lines changed
2 files changed +23
-10
lines changed Original file line number Diff line number Diff line change
1
+ module . exports = async ( { github, context, core} ) => {
2
+ const fs = require ( 'fs' ) ;
3
+ const filename = "pr.txt" ;
4
+
5
+ try {
6
+ core . debug ( "Payload as it comes.." ) ;
7
+ core . debug ( context . payload ) ;
8
+ fs . writeFileSync ( `./${ filename } ` , JSON . stringify ( context . payload ) ) ;
9
+
10
+ return `PR successfully saved ${ filename } `
11
+ } catch ( err ) {
12
+ core . setFailed ( "Failed to save PR details" ) ;
13
+ console . error ( err ) ;
14
+ }
15
+ }
Original file line number Diff line number Diff line change @@ -2,23 +2,21 @@ name: Record PR number
2
2
3
3
on :
4
4
pull_request :
5
- types : [opened, edited]
5
+ types : [opened, edited, closed ]
6
6
7
7
jobs :
8
8
build :
9
9
runs-on : ubuntu-latest
10
10
11
11
steps :
12
12
- uses : actions/checkout@v3
13
- - name : Save PR number
14
- run : |
15
- mkdir -p ./pr
16
- echo ${{ github.event.number }} > ./pr/number
17
- echo "${{ github.event.pull_request.title }}" > ./pr/title
18
- echo "${{ github.event.pull_request.body }}" > ./pr/body
19
- echo "${{ github.event.pull_request.user.login }}" > ./pr/author
20
- echo "${{ github.event.action }}" > ./pr/action
13
+ - name : " Extract PR details"
14
+ uses : actions/github-script@v6
15
+ with :
16
+ script : |
17
+ const script = require('.github/scripts/save_pr_details.js')
18
+ await script({github, context, core})
21
19
- uses : actions/upload-artifact@v3
22
20
with :
23
21
name : pr
24
- path : pr/
22
+ path : pr.txt
You can’t perform that action at this time.
0 commit comments