Skip to content

Commit 4329428

Browse files
committed
fix: token usage
1 parent 1b3a5e9 commit 4329428

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151

5252
### `token`
5353

54-
**Optional** Access token to the repository. Uses `${{ github.token }}` by default.
54+
**Optional** Access token to the repository. If not set, the action will use the default GitHub Actions token at runtime.
5555

5656
### `subject_pattern`
5757

action.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ inputs:
1414
default: "true"
1515
token:
1616
required: false
17-
description: Access token to the repository. Uses `${{ github.token }}` by default.
18-
default: ${{ github.token }}
17+
description: Access token to the repository. If not set, the action will use the default GitHub Actions token at runtime.
1918
subject_pattern:
2019
required: false
2120
description: A regex pattern to validate the subject of the commit message.

src/github.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let once = false;
88

99
function getClient(): InstanceType<typeof GitHub> {
1010
if (once) return octokit;
11-
const token = getInput("token");
11+
const token = getInput("token") || process.env["GITHUB_TOKEN"] || "";
1212
setSecret(token);
1313

1414
octokit = getOctokit(token);

0 commit comments

Comments
 (0)