Skip to content

Commit 6aa753a

Browse files
authored
Rename token to github_token (#14)
1 parent 36fa559 commit 6aa753a

File tree

5 files changed

+16
-11
lines changed

5 files changed

+16
-11
lines changed

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ inputs:
99
ignore:
1010
description: 'Comma-separated list of package managers to ignore when configuring all (e.g., docker,pip)'
1111
required: false
12-
token:
12+
github_token:
1313
description: 'GitHub token for accessing workflow run information'
1414
required: false
1515
default: ${{ github.token }}

lib/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
// Copyright (c) JFrog Ltd. (2025)
1010
Object.defineProperty(exports, "__esModule", ({ value: true }));
11-
exports.GITHUB_STATUS_SKIPPED = exports.GITHUB_STATUS_TIMED_OUT = exports.GITHUB_STATUS_CANCELLED = exports.GITHUB_STATUS_FAILURE = exports.GITHUB_STATUS_SUCCESS = exports.FLY_CLI_SETUP_OUTPUT_PATH = exports.FLY_CLI_PATH = exports.STATE_FLY_PACKAGE_MANAGERS = exports.STATE_FLY_ACCESS_TOKEN = exports.STATE_FLY_URL = exports.INPUT_IGNORE_PACKAGE_MANAGERS = exports.INPUT_URL = void 0;
11+
exports.GITHUB_STATUS_SKIPPED = exports.GITHUB_STATUS_TIMED_OUT = exports.GITHUB_STATUS_CANCELLED = exports.GITHUB_STATUS_FAILURE = exports.GITHUB_STATUS_SUCCESS = exports.FLY_CLI_SETUP_OUTPUT_PATH = exports.FLY_CLI_PATH = exports.STATE_FLY_PACKAGE_MANAGERS = exports.STATE_FLY_ACCESS_TOKEN = exports.STATE_FLY_URL = exports.INPUT_GITHUB_TOKEN = exports.INPUT_IGNORE_PACKAGE_MANAGERS = exports.INPUT_URL = void 0;
1212
exports.INPUT_URL = "url";
1313
exports.INPUT_IGNORE_PACKAGE_MANAGERS = "ignore";
14+
exports.INPUT_GITHUB_TOKEN = "github_token";
1415
exports.STATE_FLY_URL = "fly-url";
1516
exports.STATE_FLY_ACCESS_TOKEN = "fly-access-token";
1617
exports.STATE_FLY_PACKAGE_MANAGERS = "fly-package-managers";

lib/post.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
// Copyright (c) JFrog Ltd. (2025)
1010
Object.defineProperty(exports, "__esModule", ({ value: true }));
11-
exports.GITHUB_STATUS_SKIPPED = exports.GITHUB_STATUS_TIMED_OUT = exports.GITHUB_STATUS_CANCELLED = exports.GITHUB_STATUS_FAILURE = exports.GITHUB_STATUS_SUCCESS = exports.FLY_CLI_SETUP_OUTPUT_PATH = exports.FLY_CLI_PATH = exports.STATE_FLY_PACKAGE_MANAGERS = exports.STATE_FLY_ACCESS_TOKEN = exports.STATE_FLY_URL = exports.INPUT_IGNORE_PACKAGE_MANAGERS = exports.INPUT_URL = void 0;
11+
exports.GITHUB_STATUS_SKIPPED = exports.GITHUB_STATUS_TIMED_OUT = exports.GITHUB_STATUS_CANCELLED = exports.GITHUB_STATUS_FAILURE = exports.GITHUB_STATUS_SUCCESS = exports.FLY_CLI_SETUP_OUTPUT_PATH = exports.FLY_CLI_PATH = exports.STATE_FLY_PACKAGE_MANAGERS = exports.STATE_FLY_ACCESS_TOKEN = exports.STATE_FLY_URL = exports.INPUT_GITHUB_TOKEN = exports.INPUT_IGNORE_PACKAGE_MANAGERS = exports.INPUT_URL = void 0;
1212
exports.INPUT_URL = "url";
1313
exports.INPUT_IGNORE_PACKAGE_MANAGERS = "ignore";
14+
exports.INPUT_GITHUB_TOKEN = "github_token";
1415
exports.STATE_FLY_URL = "fly-url";
1516
exports.STATE_FLY_ACCESS_TOKEN = "fly-access-token";
1617
exports.STATE_FLY_PACKAGE_MANAGERS = "fly-package-managers";
@@ -70,7 +71,7 @@ exports.createJobSummary = createJobSummary;
7071
const core = __importStar(__nccwpck_require__(7484));
7172
const fs = __importStar(__nccwpck_require__(9896));
7273
const path = __importStar(__nccwpck_require__(6928));
73-
async function createJobSummary(packageManagers) {
74+
async function createJobSummary() {
7475
try {
7576
// Build release URL
7677
const fullRepo = process.env.GITHUB_REPOSITORY;
@@ -159,18 +160,18 @@ const job_summary_1 = __nccwpck_require__(5175);
159160
function getGitHubEnvironment() {
160161
const runId = process.env.GITHUB_RUN_ID;
161162
const repository = process.env.GITHUB_REPOSITORY;
162-
const token = core.getInput("token") || process.env.GITHUB_TOKEN;
163+
const githubToken = core.getInput(constants_1.INPUT_GITHUB_TOKEN) || process.env.GITHUB_TOKEN;
163164
const jobName = process.env.GITHUB_JOB;
164165
core.info(`🔍 Checking job status for run ${runId} in repo ${repository}`);
165166
core.info(`📋 Current job: ${jobName}`);
166-
if (!runId || !repository || !token) {
167+
if (!runId || !repository || !githubToken) {
167168
core.warning("Missing GitHub environment variables, assuming job succeeded since post action is running");
168169
return null;
169170
}
170171
return {
171172
runId: runId,
172173
repository: repository,
173-
token: token,
174+
token: githubToken,
174175
jobName: jobName,
175176
};
176177
}
@@ -306,7 +307,7 @@ async function runPost() {
306307
// Only create job summary if the job succeeded
307308
if (determinedStatus === constants_1.GITHUB_STATUS_SUCCESS) {
308309
core.info("📋 Creating job summary for successful job...");
309-
await (0, job_summary_1.createJobSummary)(packageManagers);
310+
await (0, job_summary_1.createJobSummary)();
310311
}
311312
else {
312313
core.info("⚠️ Skipping job summary creation - job did not succeed");

src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
export const INPUT_URL = "url";
44
export const INPUT_IGNORE_PACKAGE_MANAGERS = "ignore";
5+
export const INPUT_GITHUB_TOKEN = "github_token";
56

67
export const STATE_FLY_URL = "fly-url";
78
export const STATE_FLY_ACCESS_TOKEN = "fly-access-token";

src/post.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
GITHUB_STATUS_FAILURE,
1111
GITHUB_STATUS_CANCELLED,
1212
GITHUB_STATUS_TIMED_OUT,
13+
INPUT_GITHUB_TOKEN,
1314
} from "./constants";
1415
import { HttpClient } from "@actions/http-client";
1516
import { EndCiRequest } from "./types";
@@ -40,13 +41,14 @@ interface GitHubEnv {
4041
function getGitHubEnvironment(): GitHubEnv | null {
4142
const runId = process.env.GITHUB_RUN_ID;
4243
const repository = process.env.GITHUB_REPOSITORY;
43-
const token = core.getInput("token") || process.env.GITHUB_TOKEN;
44+
const githubToken =
45+
core.getInput(INPUT_GITHUB_TOKEN) || process.env.GITHUB_TOKEN;
4446
const jobName = process.env.GITHUB_JOB;
4547

4648
core.info(`🔍 Checking job status for run ${runId} in repo ${repository}`);
4749
core.info(`📋 Current job: ${jobName}`);
4850

49-
if (!runId || !repository || !token) {
51+
if (!runId || !repository || !githubToken) {
5052
core.warning(
5153
"Missing GitHub environment variables, assuming job succeeded since post action is running",
5254
);
@@ -56,7 +58,7 @@ function getGitHubEnvironment(): GitHubEnv | null {
5658
return {
5759
runId: runId!,
5860
repository: repository!,
59-
token: token!,
61+
token: githubToken!,
6062
jobName: jobName!,
6163
};
6264
}

0 commit comments

Comments
 (0)