From 1af865e2e8336ccd06a8838fe941b4a60430de70 Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Mon, 6 Apr 2026 13:36:58 +0900 Subject: [PATCH] ci: use `pull_request_target` for PR comment and label task (#10075) Co-authored-by: Codex --- .github/workflows/issue-labeled.yml | 5 ++--- .github/workflows/pr-labeled-automated.yml | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml index 4a58c2ae5..e7788cfee 100644 --- a/.github/workflows/issue-labeled.yml +++ b/.github/workflows/issue-labeled.yml @@ -3,13 +3,12 @@ name: Issue Labeled on: issues: types: [labeled] - pull_request: + pull_request_target: types: [labeled] # for actions-cool/issues-helper to update issues permissions: issues: write - pull-requests: write jobs: reply-labeled: @@ -43,7 +42,7 @@ jobs: *These measures help us reduce maintenance burden and keep the team's work efficient. See our [AI contributions policy](https://github.com/vitest-dev/vitest/blob/main/CONTRIBUTING.md#ai-contributions) for more context.* - name: maybe automated (pr) - if: github.event.label.name == 'maybe automated' && github.event_name == 'pull_request' + if: github.event.label.name == 'maybe automated' && github.event_name == 'pull_request_target' uses: actions-cool/issues-helper@71b62d7da76e59ff7b193904feb6e77d4dbb2777 # v3.7.6 with: actions: create-comment diff --git a/.github/workflows/pr-labeled-automated.yml b/.github/workflows/pr-labeled-automated.yml index 15c1a357b..c78cec800 100644 --- a/.github/workflows/pr-labeled-automated.yml +++ b/.github/workflows/pr-labeled-automated.yml @@ -1,11 +1,11 @@ name: Label Automated PR on: - pull_request: + pull_request_target: types: [opened, edited] permissions: - pull-requests: write + issues: write jobs: label: -- 2.51.2