From 9bea939ce7bb1704c3a8e4e47a610f3bf4adc636 Mon Sep 17 00:00:00 2001 From: Github Date: Thu, 31 Oct 2024 21:07:45 +1100 Subject: [PATCH 1/4] Use `pull_request_target` event for actions --- .github/workflows/check-dist.yml | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/git-town.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml index 6fed174..d5fc723 100644 --- a/.github/workflows/check-dist.yml +++ b/.github/workflows/check-dist.yml @@ -10,7 +10,7 @@ name: Check Transpiled JavaScript on: - pull_request: + pull_request_target: branches: - '**' push: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 746c51e..db0de63 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,7 @@ name: CI on: - pull_request: + pull_request_target: branches: - '**' push: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 41b440a..ef22434 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,7 +1,7 @@ name: CodeQL on: - pull_request: + pull_request_target: branches: - '**' push: diff --git a/.github/workflows/git-town.yml b/.github/workflows/git-town.yml index 85105ad..b6dfceb 100644 --- a/.github/workflows/git-town.yml +++ b/.github/workflows/git-town.yml @@ -1,7 +1,7 @@ name: Git Town on: - pull_request: + pull_request_target: branches: - '**' From 410781adb21ef773b9048bac23279fb8493086b5 Mon Sep 17 00:00:00 2001 From: Github Date: Thu, 31 Oct 2024 21:22:11 +1100 Subject: [PATCH 2/4] update event --- .github/workflows/check-dist.yml | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/git-town.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml index d5fc723..6fed174 100644 --- a/.github/workflows/check-dist.yml +++ b/.github/workflows/check-dist.yml @@ -10,7 +10,7 @@ name: Check Transpiled JavaScript on: - pull_request_target: + pull_request: branches: - '**' push: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db0de63..746c51e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,7 @@ name: CI on: - pull_request_target: + pull_request: branches: - '**' push: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index ef22434..41b440a 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,7 +1,7 @@ name: CodeQL on: - pull_request_target: + pull_request: branches: - '**' push: diff --git a/.github/workflows/git-town.yml b/.github/workflows/git-town.yml index b6dfceb..85105ad 100644 --- a/.github/workflows/git-town.yml +++ b/.github/workflows/git-town.yml @@ -1,7 +1,7 @@ name: Git Town on: - pull_request_target: + pull_request: branches: - '**' From 3c47ecf1756910b464e359b6811d3482173e0e4d Mon Sep 17 00:00:00 2001 From: Github Date: Thu, 31 Oct 2024 21:31:57 +1100 Subject: [PATCH 3/4] feat: fetch all repo PRs instead of just open PRs --- src/inputs.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/inputs.ts b/src/inputs.ts index 95bbea5..282dbd2 100644 --- a/src/inputs.ts +++ b/src/inputs.ts @@ -127,11 +127,11 @@ export const inputs = { }, async getPullRequests(octokit: Octokit, context: typeof github.context) { - const pullRequests = await octokit.paginate( + const openPullRequests = await octokit.paginate( 'GET /repos/{owner}/{repo}/pulls', { ...context.repo, - state: 'open', + state: 'all', per_page: 100, }, (response) => @@ -147,10 +147,10 @@ export const inputs = { core.startGroup('Inputs: Pull requests') core.info( - JSON.stringify(pullRequests.map(({ body: _, ...pullRequest }) => pullRequest)) + JSON.stringify(openPullRequests.map(({ body: _, ...pullRequest }) => pullRequest)) ) core.endGroup() - return pullRequests + return openPullRequests }, } From 48189b03c8c488483dc580be1b12b2f59ea85c29 Mon Sep 17 00:00:00 2001 From: Github Date: Thu, 31 Oct 2024 21:37:00 +1100 Subject: [PATCH 4/4] update dist --- dist/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 41bf522..03e2208 100644 --- a/dist/index.js +++ b/dist/index.js @@ -46921,11 +46921,11 @@ var inputs = { } }, async getPullRequests(octokit, context3) { - const pullRequests = await octokit.paginate( + const openPullRequests = await octokit.paginate( "GET /repos/{owner}/{repo}/pulls", { ...context3.repo, - state: "open", + state: "all", per_page: 100 }, (response) => response.data.map( @@ -46939,10 +46939,10 @@ var inputs = { ); core2.startGroup("Inputs: Pull requests"); core2.info( - JSON.stringify(pullRequests.map(({ body: _, ...pullRequest }) => pullRequest)) + JSON.stringify(openPullRequests.map(({ body: _, ...pullRequest }) => pullRequest)) ); core2.endGroup(); - return pullRequests; + return openPullRequests; } };