Skip to content

Commit 8594781

Browse files
[MH-13160] add env vars for github action comment (#182)
1 parent d1d5c9b commit 8594781

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/main.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { getInput, getBooleanInput, info, setFailed } from "@actions/core";
22
import { exec } from "@actions/exec";
3+
import { context as githubContext } from '@actions/github';
34
import { downloadTool } from "@actions/tool-cache";
45
import { readFileSync, chmodSync } from "fs";
56

@@ -40,6 +41,13 @@ function getConfig(): Config {
4041
const githubToken: string = getInput("github-token", {
4142
required: true,
4243
});
44+
process.env["GITHUB_TOKEN"] = githubToken;
45+
46+
const issueNumber = githubContext.issue.number
47+
if (issueNumber) {
48+
process.env['GITHUB_ISSUE_ID'] = String(issueNumber)
49+
}
50+
4351

4452
const repo = process.env["GITHUB_REPOSITORY"];
4553
if (repo === undefined) {
@@ -189,8 +197,8 @@ async function run(): Promise<void> {
189197
${waitArgsString}; then
190198
exit 3;
191199
fi
192-
193-
200+
201+
194202
# check status, exit with non-zero status if failed or stopped
195203
status=$(${cli} --verbosity ${config.verbosity} show \
196204
--owner ${config.owner} \

0 commit comments

Comments
 (0)