From b7a834271bbb1418981cb417e7b364ec2663cd1a Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Wed, 7 Feb 2024 11:26:01 +0000 Subject: [PATCH] refactor: Automatically review pull requests Use this link to re-run the recipe: https://app.moderne.io/recipes/builder/OUSuHnCME?organizationId=T3BlblJld3JpdGU%3D Co-authored-by: Moderne --- .github/workflows/comment-pr.yml | 15 +++++++++++++++ .github/workflows/receive-pr.yml | 11 +++++++++++ 2 files changed, 26 insertions(+) diff --git a/.github/workflows/comment-pr.yml b/.github/workflows/comment-pr.yml index e69de29..f30bbd9 100644 --- a/.github/workflows/comment-pr.yml +++ b/.github/workflows/comment-pr.yml @@ -0,0 +1,15 @@ +name: comment-pr +# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow +on: + workflow_run: + workflows: ["receive-pr"] + types: + - completed +# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ +# Since this pull request has write permissions on the target repo, we should **NOT** execute any untrusted code. +jobs: + post-suggestions: + if: ${{ github.event.workflow_run.conclusion == 'success' }} + uses: openrewrite/gh-automation/.github/workflows/comment-pr.yml@main + secrets: + GH_PAT_ACTIONS_READ: ${{ secrets.GH_PAT_ACTIONS_READ }} diff --git a/.github/workflows/receive-pr.yml b/.github/workflows/receive-pr.yml index e69de29..a93c527 100644 --- a/.github/workflows/receive-pr.yml +++ b/.github/workflows/receive-pr.yml @@ -0,0 +1,11 @@ +name: receive-pr +on: + pull_request: + types: [opened, synchronize] + branches: + - main +# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ +# Since this pull request receives untrusted code, we should **NOT** have any secrets in the environment. +jobs: + upload-patch: + uses: openrewrite/gh-automation/.github/workflows/receive-pr.yml@main