From 4da1b106ffc9dfe59af860e4a6a54d66990de28d Mon Sep 17 00:00:00 2001 From: Sven Klemm Date: Sun, 28 Apr 2024 08:47:35 +0200 Subject: [PATCH] Use dedicated token for pr assignment Since changing the default permissions of the GITHUB_TOKEN this workflow was failing with insufficient permissions. --- .github/auto_assign.yml | 6 +++++ .github/workflows/pr-handling.yaml | 38 ++++++++++++++++-------------- 2 files changed, 26 insertions(+), 18 deletions(-) create mode 100644 .github/auto_assign.yml diff --git a/.github/auto_assign.yml b/.github/auto_assign.yml new file mode 100644 index 00000000000..dd24c0892f9 --- /dev/null +++ b/.github/auto_assign.yml @@ -0,0 +1,6 @@ + +addReviewers: false + +# Set to true to add assignees to pull requests +addAssignees: author + diff --git a/.github/workflows/pr-handling.yaml b/.github/workflows/pr-handling.yaml index fbeab3d70e9..06d8ba85312 100644 --- a/.github/workflows/pr-handling.yaml +++ b/.github/workflows/pr-handling.yaml @@ -15,27 +15,29 @@ name: Assign PR to author and reviewers types: [ opened, reopened, ready_for_review ] jobs: + assign-pr: name: Assign PR to author permissions: - contents: write + contents: read # for kentaro-m/auto-assign-action to fetch config file + pull-requests: write # for kentaro-m/auto-assign-action to assign PR reviewers runs-on: ubuntu-latest steps: - - uses: toshimaru/auto-author-assign@v2.1.0 + - uses: kentaro-m/auto-assign-action@v1.2.6 - ask-review: - name: Run pull-review - runs-on: ubuntu-latest - if: ${{ !github.event.pull_request.draft }} - steps: - - uses: actions/checkout@v4 - - name: Run pull-review with docker - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - OWNER: ${{ github.repository_owner }} - REPO: ${{ github.event.repository.name }} - PULL_REQUEST_NUMBER : ${{ github.event.pull_request.number }} - shell: bash - run: | - PR_URL="https://github.com/${OWNER}/${REPO}/pull/${PULL_REQUEST_NUMBER}" - docker run ghcr.io/imsky/pull-review "$PR_URL" --github-token "${GITHUB_TOKEN}" +# ask-review: +# name: Run pull-review +# runs-on: ubuntu-latest +# if: ${{ !github.event.pull_request.draft }} +# steps: +# - uses: actions/checkout@v4 +# - name: Run pull-review with docker +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# OWNER: ${{ github.repository_owner }} +# REPO: ${{ github.event.repository.name }} +# PULL_REQUEST_NUMBER : ${{ github.event.pull_request.number }} +# shell: bash +# run: | +# PR_URL="https://github.com/${OWNER}/${REPO}/pull/${PULL_REQUEST_NUMBER}" +# docker run ghcr.io/imsky/pull-review "$PR_URL" --github-token "${GITHUB_TOKEN}"