From b822c2c60b519f45fdf0da7fb3a574d62a25bcfd Mon Sep 17 00:00:00 2001 From: Lau Chaves Date: Mon, 25 Nov 2024 00:57:41 -0600 Subject: [PATCH 1/2] Fix: GA Auto assign prs --- .github/workflows/auto-assign.yml | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/auto-assign.yml diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml new file mode 100644 index 0000000..f05c9bd --- /dev/null +++ b/.github/workflows/auto-assign.yml @@ -0,0 +1,35 @@ +name: Auto Assign PRs + +on: + pull_request: + types: [opened, reopened] + +jobs: + assign: + runs-on: ubuntu-latest + steps: + - name: Assign Reviewers and Assignees + uses: actions/github-script@v6 + with: + script: | + const { github, context } = require('@actions/github'); + const reviewers = ['danielcdz']; + const assignees = [context.actor]; + + // Add reviewers + await github.rest.pulls.requestReviewers({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + reviewers, + }); + + // Add assignees + await github.rest.issues.addAssignees({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + assignees, + }); + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 69a7b166c9badca3682cf2103a09bd7e1267d812 Mon Sep 17 00:00:00 2001 From: Lau Chaves Date: Mon, 25 Nov 2024 01:23:49 -0600 Subject: [PATCH 2/2] Fix error --- .github/workflows/auto-assign.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index f05c9bd..d81e9a6 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -12,7 +12,6 @@ jobs: uses: actions/github-script@v6 with: script: | - const { github, context } = require('@actions/github'); const reviewers = ['danielcdz']; const assignees = [context.actor]; @@ -23,7 +22,7 @@ jobs: pull_number: context.payload.pull_request.number, reviewers, }); - + // Add assignees await github.rest.issues.addAssignees({ owner: context.repo.owner,