57
57
fs.writeFileSync(path.join(temp, 'pr_number.zip'), Buffer.from(download.data));
58
58
59
59
- name : Unzip downloaded PR number artifact
60
+ # The name of the output require-result is a bit confusing, but when its value
61
+ # is 'false', it means that the triggering actor does NOT have the required
62
+ # permission.
60
63
if : ${{ !env.ACT && steps.permission.outputs.require-result == 'false' }}
61
64
run : unzip "${{ runner.temp }}/artifacts/pr_number.zip" -d "${{ runner.temp }}/artifacts"
62
65
@@ -80,15 +83,15 @@ jobs:
80
83
const { owner, repo } = context.repo;
81
84
82
85
// Read the PR number from the downloaded and unzipped artifact.
83
- const issue_number = Number(fs.readFileSync(path.join(temp, 'pr_number')));
86
+ const pr_number = Number(fs.readFileSync(path.join(temp, 'pr_number')));
84
87
85
88
// Get the URL of the PR so we can add a link in the PR comment.
86
- const { html_url } = await github.rest.issues .get({ owner, repo, issue_number });
89
+ const { html_url } = await github.rest.pulls .get({ owner, repo, pr_number });
87
90
88
91
github.rest.issues.createComment({
89
92
owner,
90
93
repo,
91
- issue_number ,
94
+ pr_number ,
92
95
body: "User [${{ github.triggering_actor }}](${{ github.event.workflow_run.head_repository.owner.html_url }})"
93
96
+ " does not have permission to run integration tests. A maintainer must perform a security review of the"
94
97
+ ` [code changes in this pull request](${html_url}/files) and re-run the`
0 commit comments