diff --git a/README.md b/README.md index b830023..418a815 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: lee-dohm/no-response@v0.5.0 - with: - token: ${{ github.token }} ``` ### Inputs @@ -35,7 +33,7 @@ See [`action.yml`](action.yml) for defaults. - `daysUntilClose` — Number of days to wait for a response from the original author before closing. - `responseRequiredColor` — Color for the `responseRequiredLabel`. **Only** used when creating the label if it does not already exist. - `responseRequiredLabel` — Text of the label used to indicate that a response from the original author is required. -- `token` — Token used to access repo information. The default GitHub Actions token is sufficient. +- `token` — Token used to access repo information. The default GitHub Actions token is sufficient. Defaults to `github.token`. ### Outputs diff --git a/action.yml b/action.yml index 1eb04cb..f2b54dd 100644 --- a/action.yml +++ b/action.yml @@ -20,7 +20,8 @@ inputs: default: more-information-needed token: description: Token to access the GitHub API - required: true + required: false + default: ${{ github.token }} runs: using: node12 main: 'dist/index.js' diff --git a/src/config.ts b/src/config.ts index 3d35187..458c692 100644 --- a/src/config.ts +++ b/src/config.ts @@ -57,7 +57,7 @@ export default class Config { 'more-information-needed' ) - this.token = core.getInput('token', { required: true }) + this.token = core.getInput('token') } valueOrDefault(value: string, defaultValue: string): string { diff --git a/test/config.test.ts b/test/config.test.ts index 4211ba9..480d862 100644 --- a/test/config.test.ts +++ b/test/config.test.ts @@ -84,13 +84,5 @@ describe('Config', () => { expect(config.token).toEqual('123456789abcdef') }) - - it('raises an error if no token is given', () => { - delete process.env.INPUT_TOKEN - - expect(() => { - new Config() - }).toThrow() - }) }) })