From 339c06858dba064a46a00753ab83bad86b3c679e Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Mon, 5 Feb 2024 11:45:50 +0000 Subject: [PATCH] refactor: Automatically review PRs Use this link to re-run the recipe: https://app.moderne.io/recipes/builder/J6z7fPbqf?organizationId=T3BlblJld3JpdGU%3D Co-authored-by: Moderne --- .github/workflows/comment-pr.yml | 16 ++++++++++++++++ .github/workflows/receive-pr.yml | 12 ++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 .github/workflows/comment-pr.yml create mode 100644 .github/workflows/receive-pr.yml diff --git a/.github/workflows/comment-pr.yml b/.github/workflows/comment-pr.yml new file mode 100644 index 000000000..d9b2c499c --- /dev/null +++ b/.github/workflows/comment-pr.yml @@ -0,0 +1,16 @@ +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: + 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 new file mode 100644 index 000000000..f336716fa --- /dev/null +++ b/.github/workflows/receive-pr.yml @@ -0,0 +1,12 @@ +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