Skip to content

Commit 13c0743

Browse files
committed
chore: try to use default again
1 parent 0e7766c commit 13c0743

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

action.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ inputs:
1515
token:
1616
required: false
1717
description: Access token to the repository. If not set, the action will use the default GitHub Actions token at runtime.
18+
default: ${{ github.token }}
1819
subject_pattern:
1920
required: false
2021
description: A regex pattern to validate the subject of the commit message.

src/github.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ let once = false;
88

99
function getClient(): InstanceType<typeof GitHub> {
1010
if (once) return octokit;
11-
let token = getInput("token");
11+
const token = getInput("token") || process.env["GITHUB_TOKEN"] || "";
1212
if (!token) {
13-
token = process.env["GITHUB_TOKEN"] || "";
13+
throw new Error("GitHub token is required but not provided.");
1414
}
1515
setSecret(token);
1616

0 commit comments

Comments
 (0)