From a100061ba9511ed9d7f0799b6184e247300dd1de Mon Sep 17 00:00:00 2001 From: maiieul <45822175+maiieul@users.noreply.github.com> Date: Wed, 15 Oct 2025 08:10:08 +0200 Subject: [PATCH 1/5] chore: autmatically assign core team members to their PRs --- .github/workflows/auto-assign-core-team.yml | 50 +++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/auto-assign-core-team.yml diff --git a/.github/workflows/auto-assign-core-team.yml b/.github/workflows/auto-assign-core-team.yml new file mode 100644 index 00000000000..9cf1678252d --- /dev/null +++ b/.github/workflows/auto-assign-core-team.yml @@ -0,0 +1,50 @@ +name: Auto-assign PRs to core team authors + +on: + pull_request_target: + types: [opened, reopened, ready_for_review] + +permissions: + pull-requests: write + contents: read + +jobs: + auto_assign: + name: Assign PR author when core team member + runs-on: ubuntu-latest + if: github.event.pull_request.draft == false + steps: + - name: Check team membership via REST + id: team + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ORG: QwikDev + TEAM_SLUG: qwik-team + AUTHOR: ${{ github.event.pull_request.user.login }} + run: | + RESPONSE=$(curl -s \ + -H "Authorization: token ${GH_TOKEN}" \ + -H "Accept: application/vnd.github+json" \ + "https://api.github.com/orgs/${ORG}/teams/${TEAM_SLUG}/memberships/${AUTHOR}") + + STATE=$(echo "$RESPONSE" | jq -r '.state // empty') + if [ "$STATE" = "active" ]; then + echo "isCore=true" >> $GITHUB_OUTPUT + else + echo "isCore=false" >> $GITHUB_OUTPUT + fi + + - name: Assign PR to author + if: steps.team.outputs.isCore == 'true' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + PR_NUMBER=${{ github.event.pull_request.number }} + AUTHOR=${{ github.event.pull_request.user.login }} + curl -s -H "Authorization: token ${GH_TOKEN}" \ + -H "Accept: application/vnd.github+json" \ + -X POST \ + -d "{\"assignees\":[\"${AUTHOR}\"]}" \ + https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/assignees + + From e5520cf09c2e1c2b0393fd97b82d551fef924970 Mon Sep 17 00:00:00 2001 From: maiieul <45822175+maiieul@users.noreply.github.com> Date: Wed, 15 Oct 2025 08:18:58 +0200 Subject: [PATCH 2/5] chore: add core-team PR to Qwik Development project --- .github/workflows/auto-assign-core-team.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/auto-assign-core-team.yml b/.github/workflows/auto-assign-core-team.yml index 9cf1678252d..b419c2ef97a 100644 --- a/.github/workflows/auto-assign-core-team.yml +++ b/.github/workflows/auto-assign-core-team.yml @@ -47,4 +47,12 @@ jobs: -d "{\"assignees\":[\"${AUTHOR}\"]}" \ https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/assignees + - name: Add PR to Qwik Development project + if: steps.team.outputs.isCore == 'true' + uses: actions/add-to-project@v0.6.1 + with: + # https://github.com/orgs/QwikDev/projects/1 + project-url: https://github.com/orgs/QwikDev/projects/1 + github-token: ${{ secrets.QWIK_API_TOKEN_GITHUB }} + From 43ce270b57df03f121471f54fd591082d1797e3c Mon Sep 17 00:00:00 2001 From: maiieul <45822175+maiieul@users.noreply.github.com> Date: Wed, 15 Oct 2025 08:28:43 +0200 Subject: [PATCH 3/5] chore: auto assign core-team PR to proper project status (progress or review) --- .github/workflows/auto-assign-core-team.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-assign-core-team.yml b/.github/workflows/auto-assign-core-team.yml index b419c2ef97a..c1b9628a365 100644 --- a/.github/workflows/auto-assign-core-team.yml +++ b/.github/workflows/auto-assign-core-team.yml @@ -2,7 +2,7 @@ name: Auto-assign PRs to core team authors on: pull_request_target: - types: [opened, reopened, ready_for_review] + types: [opened, reopened, ready_for_review, converted_to_draft] permissions: pull-requests: write @@ -12,7 +12,6 @@ jobs: auto_assign: name: Assign PR author when core team member runs-on: ubuntu-latest - if: github.event.pull_request.draft == false steps: - name: Check team membership via REST id: team @@ -55,4 +54,20 @@ jobs: project-url: https://github.com/orgs/QwikDev/projects/1 github-token: ${{ secrets.QWIK_API_TOKEN_GITHUB }} + - name: Ensure project + set Status: In progress (draft) + if: steps.team.outputs.isCore == 'true' && github.event.pull_request.draft == true + uses: actions/add-to-project@v0.6.1 + with: + project-url: https://github.com/orgs/QwikDev/projects/1 + github-token: ${{ secrets.QWIK_API_TOKEN_GITHUB }} + fields: | + Status: In progress + - name: Ensure project + set Status: Waiting For Review (ready) + if: steps.team.outputs.isCore == 'true' && github.event.pull_request.draft == false + uses: actions/add-to-project@v0.6.1 + with: + project-url: https://github.com/orgs/QwikDev/projects/1 + github-token: ${{ secrets.QWIK_API_TOKEN_GITHUB }} + fields: | + Status: Waiting For Review \ No newline at end of file From 4d7f5f57804e6dcdf33ed76acf2ba719b1471033 Mon Sep 17 00:00:00 2001 From: maiieul <45822175+maiieul@users.noreply.github.com> Date: Wed, 15 Oct 2025 09:16:49 +0200 Subject: [PATCH 4/5] chore: remove comment --- .github/workflows/auto-assign-core-team.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/auto-assign-core-team.yml b/.github/workflows/auto-assign-core-team.yml index c1b9628a365..ef6ba56fc1a 100644 --- a/.github/workflows/auto-assign-core-team.yml +++ b/.github/workflows/auto-assign-core-team.yml @@ -50,7 +50,6 @@ jobs: if: steps.team.outputs.isCore == 'true' uses: actions/add-to-project@v0.6.1 with: - # https://github.com/orgs/QwikDev/projects/1 project-url: https://github.com/orgs/QwikDev/projects/1 github-token: ${{ secrets.QWIK_API_TOKEN_GITHUB }} From d484028fb6253057f8746d3997ca0d98f0f692c9 Mon Sep 17 00:00:00 2001 From: maiieul <45822175+maiieul@users.noreply.github.com> Date: Wed, 15 Oct 2025 16:59:23 +0200 Subject: [PATCH 5/5] fix: yml error --- .github/workflows/auto-assign-core-team.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-assign-core-team.yml b/.github/workflows/auto-assign-core-team.yml index ef6ba56fc1a..19331d9bd67 100644 --- a/.github/workflows/auto-assign-core-team.yml +++ b/.github/workflows/auto-assign-core-team.yml @@ -53,7 +53,7 @@ jobs: project-url: https://github.com/orgs/QwikDev/projects/1 github-token: ${{ secrets.QWIK_API_TOKEN_GITHUB }} - - name: Ensure project + set Status: In progress (draft) + - name: Ensure project + set Status to "In progress" (draft) if: steps.team.outputs.isCore == 'true' && github.event.pull_request.draft == true uses: actions/add-to-project@v0.6.1 with: @@ -62,7 +62,7 @@ jobs: fields: | Status: In progress - - name: Ensure project + set Status: Waiting For Review (ready) + - name: Ensure project + set Status to "Waiting For Review" (ready) if: steps.team.outputs.isCore == 'true' && github.event.pull_request.draft == false uses: actions/add-to-project@v0.6.1 with: