From e39453c79a9ee71e89fafc2ba5688d4f9761a82e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Fri, 19 Aug 2022 02:15:34 +0200 Subject: [PATCH 1/4] feat: default `github-token` to `github.token` --- action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 547800a..acdad41 100644 --- a/action.yml +++ b/action.yml @@ -5,8 +5,9 @@ branding: color: 'green' inputs: github-token: + default: ${{ github.token }} description: 'The GITHUB_TOKEN secret' - required: true + required: false runs: using: 'node12' main: 'dist/index.js' From 4a2f5ecb32b43f6c3b2edbf0274cfe3b9fb7c960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Fri, 19 Aug 2022 02:17:25 +0200 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 51c3ca0..ec7f008 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This is a fork of `hmarr/auto-approve-action`. -Automatically approve GitHub pull requests. The `GITHUB_TOKEN` secret must be provided as the `github-token` input for the action to work. +Automatically approve GitHub pull requests. ## Usage instructions @@ -24,8 +24,6 @@ jobs: - name: Auto approve uses: cognitedata/auto-approve-dependabot-action@v3.0.1 if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]' - with: - github-token: ${{ secrets.GITHUB_TOKEN }} ``` ## Why? From d442b578cbee3d8531076592b3f6ad7a60b61390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Fri, 19 Aug 2022 02:18:37 +0200 Subject: [PATCH 3/4] Update main.ts --- src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 9b4242e..7d73f3a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -71,7 +71,7 @@ async function remove_dependabot_approvals(client: any, pr: any) { async function run() { try { - const token = core.getInput('github-token', { required: true }); + const token = core.getInput('github-token'); const { pull_request: pr } = github.context.payload; if (!pr) { From c72184e2e9878768b3ca1d193e579ce58e3ca5a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Fri, 19 Aug 2022 02:19:47 +0200 Subject: [PATCH 4/4] Update index.js --- dist/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 2727651..315eb71 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1572,7 +1572,7 @@ function remove_dependabot_approvals(client, pr) { function run() { return __awaiter(this, void 0, void 0, function* () { try { - const token = core.getInput('github-token', { required: true }); + const token = core.getInput('github-token'); const { pull_request: pr } = github.context.payload; if (!pr) { throw new Error('Event payload missing `pull_request`'); @@ -25530,4 +25530,4 @@ module.exports = options => { /***/ }) -/******/ }); \ No newline at end of file +/******/ });