From 7b9f8eb47386387cd03a36552a2fb82bd540db78 Mon Sep 17 00:00:00 2001 From: David Arthur Date: Tue, 4 Mar 2025 10:34:11 -0500 Subject: [PATCH] fix pr-reviewed for forks --- .github/workflows/README.md | 5 ++++- .../{ci-requested.yml => workflow-requested.yml} | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) rename .github/workflows/{ci-requested.yml => workflow-requested.yml} (93%) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 1069529c47124..f0beb3f3f71c2 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -101,7 +101,7 @@ There are two files related to this workflow: * [pr-labeled.yml](pr-labeled.yml) approves a pending approval for PRs that have been labeled with `ci-approved` -* [ci-requested.yml](ci-requested.yml) approves future workflow requests automatically +* [workflow-requested.yml](workflow-requested.yml) approves future workflow requests automatically if the PR has the `ci-approved` label _The pr-labeled.yml workflow includes pull_request_target!_ @@ -119,6 +119,9 @@ or body edited. This workflow simply captures the PR number into a text file using the saved text file. This workflow runs the linter script that checks the structure of the PR +Note that the pr-reviewed.yml workflow uses the `ci-approved` mechanism described +above. + ### Stale PRs This one is straightforward. Using the "actions/stale" GitHub Action, we automatically diff --git a/.github/workflows/ci-requested.yml b/.github/workflows/workflow-requested.yml similarity index 93% rename from .github/workflows/ci-requested.yml rename to .github/workflows/workflow-requested.yml index a1da6fa34a1f8..6463c72ab0acc 100644 --- a/.github/workflows/ci-requested.yml +++ b/.github/workflows/workflow-requested.yml @@ -13,22 +13,22 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: CI Requested +name: Workflow Requested on: workflow_run: - workflows: [CI] + workflows: [CI, Pull Request Reviewed] types: - requested -run-name: CI Requested for ${{ github.event.workflow_run.display_title}} +run-name: Workflow Requested for ${{ github.event.workflow_run.display_title}} jobs: check-pr-labels: # Even though job conditionals are difficult to debug, this will reduce the number of unnecessary runs if: | github.event_name == 'workflow_run' && - github.event.workflow_run.event == 'pull_request' && + (github.event.workflow_run.event == 'pull_request' || github.event.workflow_run.event == 'pull_request_review') && github.event.workflow_run.status == 'completed' && github.event.workflow_run.conclusion == 'action_required' runs-on: ubuntu-latest