Skip to content

Commit f3b793c

Browse files
authored
Merge pull request #7 from pollenjp/feature/add-github-token
use github-token default
2 parents 0630526 + 6de5231 commit f3b793c

File tree

6 files changed

+7
-18
lines changed

6 files changed

+7
-18
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,9 @@ jobs:
5757
uses: ./
5858
with:
5959
version: ${{ matrix.version }}
60-
github_token: ${{ secrets.GITHUB_TOKEN }}
6160
- name: Detect cached
6261
uses: ./ # Check using cache by watching logs
6362
with:
6463
version: ${{ matrix.version }}
65-
github_token: ${{ secrets.GITHUB_TOKEN }}
6664
- name: check
6765
run: shfmt --version
68-
test-no-token:
69-
name: GitHub Actions Test (No Token)
70-
# GitHub API rate limit exceeds when using macos because of https://github.com/actions/runner-images/issues/602
71-
runs-on: ubuntu-latest
72-
steps:
73-
- uses: actions/checkout@v4
74-
- uses: ./
75-
with:
76-
version: latest

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ inputs:
1111
description: 'shfmt version'
1212
required: true
1313
default: 'latest'
14-
github_token:
14+
github-token:
1515
description: 'GitHub token'
1616
required: false
17-
default: ''
17+
default: ${{ github.token }}
1818
runs:
1919
using: node20
2020
main: dist/index.js

dist/index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/inputs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import * as core from '@actions/core'
22

33
export const versionInput = core.getInput('version')
4-
export const githubTokenInput = core.getInput('github_token')
4+
export const githubTokenInput = core.getInput('github-token')

src/shfmt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const getVersion = async (version: string): Promise<string> => {
7777
}
7878
}
7979
throw new Error(
80-
`Failed to get the latest version. If the reason is rate limit, please set the github_token. https://github.com/actions/runner-images/issues/602`
80+
`Failed to get the latest version. If the reason is rate limit, please set the github-token. https://github.com/actions/runner-images/issues/602`
8181
)
8282
})()
8383
const releaseResponse: ReleaseResponse =

0 commit comments

Comments
 (0)