@@ -7,13 +7,12 @@ const fs = require('fs');
7
7
* @param {Object } params.context - GitHub Actions context
8
8
* @param {Object } params.core - GitHub Actions core utilities
9
9
* @param {Object } params.exec - GitHub Actions exec utilities
10
- * @param {string } params.issueNumber - The issue number to link to (optional)
11
- * @param {string } params.fixedFilesPath - Path to the fixed files list
12
10
* @returns {Promise<number> } The created PR number
13
11
*/
14
- module . exports = async ( { github, context, core, exec, issueNumber , fixedFilesPath } ) => {
12
+ module . exports = async ( { github, context, core, exec } ) => {
15
13
try {
16
- const fixedFiles = fs . readFileSync ( fixedFilesPath , 'utf8' ) ;
14
+ const { ISSUE_NUMBER , FIXED_FILES_PATH } = process . env ;
15
+ const fixedFiles = fs . readFileSync ( FIXED_FILES_PATH , 'utf8' ) ;
17
16
18
17
// Configure git
19
18
await exec . exec ( 'git' , [ 'config' , '--local' , 'user.email' , 'action@github.com' ] ) ;
@@ -47,7 +46,7 @@ ${fixedFiles}
47
46
- Generated by monthly gopls check workflow
48
47
49
48
### Related Issue
50
- ${ issueNumber ? `Closes #${ issueNumber } ` : '' }
49
+ ${ ISSUE_NUMBER ? `Closes #${ ISSUE_NUMBER } ` : '' }
51
50
52
51
---
53
52
*This PR was automatically generated by the monthly gopls quickfix workflow.*
@@ -67,11 +66,11 @@ ${issueNumber ? `Closes #${issueNumber}` : ''}
67
66
console . log ( `Created PR #${ prNumber } ` ) ;
68
67
69
68
// Link PR to issue if issue was created
70
- if ( issueNumber ) {
69
+ if ( ISSUE_NUMBER ) {
71
70
await github . rest . issues . createComment ( {
72
71
owner : context . repo . owner ,
73
72
repo : context . repo . repo ,
74
- issue_number : parseInt ( issueNumber ) ,
73
+ issue_number : parseInt ( ISSUE_NUMBER ) ,
75
74
body : `🔗 **Pull Request Created**
76
75
77
76
A pull request has been created to address the gopls quickfix issues found in this issue.
0 commit comments