From ef81997b61da267722b2d6d30f849dc6d47cc6a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Fri, 11 Feb 2022 15:52:02 +0100 Subject: [PATCH 1/4] feat: default `token` to `github.token` --- action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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' From 281fc70194991416c8d228965fdaac21e8f2c99d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Fri, 11 Feb 2022 15:53:57 +0100 Subject: [PATCH 2/4] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 From d820665cc446f496b1451c79cef1ba52224b8afa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Fri, 11 Feb 2022 15:54:48 +0100 Subject: [PATCH 3/4] Update config.ts --- src/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { From d48a02269656e14bbdab8a8bc63b91f114b653c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Fri, 11 Feb 2022 15:57:35 +0100 Subject: [PATCH 4/4] Update config.test.ts --- test/config.test.ts | 8 -------- 1 file changed, 8 deletions(-) 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() - }) }) })