From 809c4cf65e83dd399599004aaf2c61ae4d9a01d9 Mon Sep 17 00:00:00 2001 From: David Nguyen Date: Fri, 3 Jul 2026 16:17:24 +0700 Subject: [PATCH 1/4] docs: add JSDoc comment for Toggle component --- entrypoints/popup/components/Toggle.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/entrypoints/popup/components/Toggle.tsx b/entrypoints/popup/components/Toggle.tsx index 14c4a51..c521b10 100644 --- a/entrypoints/popup/components/Toggle.tsx +++ b/entrypoints/popup/components/Toggle.tsx @@ -7,6 +7,7 @@ export interface ToggleProps { description?: string; } +/** Labeled switch row used by popup settings. */ export default function Toggle({ enabled, onChange, From 526d35d81591bf5a4b829037c44db0df5944a776 Mon Sep 17 00:00:00 2001 From: David Nguyen Date: Fri, 3 Jul 2026 16:27:57 +0700 Subject: [PATCH 2/4] refactor: change pull request trigger to pull_request_target and add checks for Dependabot --- .github/workflows/pr-auto-assign.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-auto-assign.yml b/.github/workflows/pr-auto-assign.yml index 68051d8..fd3d1c2 100644 --- a/.github/workflows/pr-auto-assign.yml +++ b/.github/workflows/pr-auto-assign.yml @@ -1,6 +1,6 @@ name: pr-auto-assign on: - pull_request: + pull_request_target: types: [opened] permissions: @@ -11,7 +11,12 @@ jobs: assign: runs-on: ubuntu-latest steps: + - name: Skip Dependabot pull requests + if: ${{github.actor == 'dependabot[bot]'}} + run: echo "Dependabot pull requests are handled by dependabot-auto-merge." + - name: Verify bot identity + if: ${{github.actor != 'dependabot[bot]'}} run: | BOT_LOGIN="$(gh api user --jq .login)" test "$BOT_LOGIN" = "eplus-bot" @@ -19,6 +24,7 @@ jobs: GH_TOKEN: ${{secrets.EPLUS_BOT_TOKEN}} - name: Upsert welcome comment + if: ${{github.actor != 'dependabot[bot]'}} run: | COMMENT_ID="$(gh api "repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/comments" \ --paginate \ @@ -48,6 +54,7 @@ jobs: GH_TOKEN: ${{secrets.EPLUS_BOT_TOKEN}} - name: Add pull request labels + if: ${{github.actor != 'dependabot[bot]'}} run: | add_label() { local name="$1" @@ -96,6 +103,7 @@ jobs: GH_TOKEN: ${{secrets.EPLUS_BOT_TOKEN}} - name: Assign PR author + if: ${{github.actor != 'dependabot[bot]'}} run: gh pr edit "$PR_NUMBER" --add-assignee "$PR_AUTHOR" --repo "$GITHUB_REPOSITORY" env: PR_NUMBER: ${{github.event.pull_request.number}} @@ -103,6 +111,7 @@ jobs: GH_TOKEN: ${{secrets.EPLUS_BOT_TOKEN}} - name: Request eplus-bot review + if: ${{github.actor != 'dependabot[bot]'}} run: gh pr edit "$PR_NUMBER" --add-reviewer eplus-bot --repo "$GITHUB_REPOSITORY" env: PR_NUMBER: ${{github.event.pull_request.number}} From 9213562fc3a64169149ee89093e4f6f9dcda78eb Mon Sep 17 00:00:00 2001 From: David Nguyen Date: Fri, 3 Jul 2026 16:30:35 +0700 Subject: [PATCH 3/4] refactor: update Dependabot auto-merge workflow to verify bot identity and use specific token --- .github/workflows/dependabot-auto-merge.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index b0b7f61..7d716de 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -16,16 +16,23 @@ jobs: with: github-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Verify bot identity + run: | + BOT_LOGIN="$(gh api user --jq .login)" + test "$BOT_LOGIN" = "eplus-bot" + env: + GH_TOKEN: ${{secrets.EPLUS_BOT_TOKEN}} + - name: Auto-merge Dependabot PRs for semver-minor updates if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}} run: gh pr merge --auto --merge "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + GH_TOKEN: ${{secrets.EPLUS_BOT_TOKEN}} - name: Auto-merge Dependabot PRs for semver-patch updates if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}} run: gh pr merge --auto --merge "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + GH_TOKEN: ${{secrets.EPLUS_BOT_TOKEN}} From e601bc4e69718ee21c393ecdd121aac0a02223be Mon Sep 17 00:00:00 2001 From: David Nguyen Date: Fri, 3 Jul 2026 16:40:57 +0700 Subject: [PATCH 4/4] refactor: enhance pull request approval workflow with checks and dynamic comment updates --- .github/workflows/pr-auto-approve.yml | 52 +++++++++++++++++++++------ 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pr-auto-approve.yml b/.github/workflows/pr-auto-approve.yml index f239576..42d4c28 100644 --- a/.github/workflows/pr-auto-approve.yml +++ b/.github/workflows/pr-auto-approve.yml @@ -39,6 +39,12 @@ jobs: HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }} GH_TOKEN: ${{secrets.EPLUS_BOT_TOKEN}} + - name: Wait for pull request checks + run: gh pr checks "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --watch --interval 10 + env: + PR_NUMBER: ${{steps.pr.outputs.number}} + GH_TOKEN: ${{secrets.EPLUS_BOT_TOKEN}} + - name: Approve pull request run: | APPROVED_FOR_HEAD="$(gh api "repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER/reviews" \ @@ -61,6 +67,36 @@ jobs: --jq ".[] | select(.user.login == \"eplus-bot\" and (.body | contains(\"$COMMENT_MARKER\"))) | .id" \ | tail -n 1)" + REFRESH_COUNT="1" + if [ -n "$COMMENT_ID" ]; then + OLD_REFRESH_COUNT="$(gh api "repos/$GITHUB_REPOSITORY/issues/comments/$COMMENT_ID" \ + --jq '.body' \ + | sed -n 's/^Approval refresh: #\([0-9][0-9]*\)$/\1/p' \ + | tail -n 1)" + + if [ -n "$OLD_REFRESH_COUNT" ]; then + REFRESH_COUNT="$((OLD_REFRESH_COUNT + 1))" + else + REFRESH_COUNT="2" + fi + fi + + APPROVAL_COMMENT="$(cat <" - APPROVAL_COMMENT: | - - - ![CI passed](https://img.shields.io/badge/CI-passed-brightgreen) - - Approved by @eplus-bot after CI passed. - - Updated: ${{ github.event.workflow_run.updated_at }} - Run attempt: #${{ github.event.workflow_run.run_attempt }} - - CI run: ${{ github.event.workflow_run.html_url }} + CI_UPDATED_AT: ${{ github.event.workflow_run.updated_at }} + CI_RUN_ATTEMPT: ${{ github.event.workflow_run.run_attempt }} + CI_RUN_URL: ${{ github.event.workflow_run.html_url }} + APPROVAL_RUN_NUMBER: ${{ github.run_number }} + APPROVAL_RUN_ATTEMPT: ${{ github.run_attempt }} GH_TOKEN: ${{secrets.EPLUS_BOT_TOKEN}}