From a8f08d93b85d77c915cdbecb4ed79161b3fe8fbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Fri, 4 Dec 2026 18:37:58 +0100 Subject: [PATCH] C++ code formatting: Replace `pull_request_target` with two-step workflows --- .../workflows/code-formatting-cleanup-pr.yml | 21 +++++++++++++++++++ .github/workflows/code-formatting.yml | 6 +++--- 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/code-formatting-cleanup-pr.yml diff --git a/.github/workflows/code-formatting-cleanup-pr.yml b/.github/workflows/code-formatting-cleanup-pr.yml new file mode 100644 index 0000000000000..4a08127469cff --- /dev/null +++ b/.github/workflows/code-formatting-cleanup-pr.yml @@ -0,0 +1,21 @@ +--- +name: Formatting cleanup PR + +'on': + workflow_run: + workflows: ["Formatting"] # must match the name of that repo's unprivileged caller + types: [completed] + +permissions: {} + +jobs: + cleanup: + if: >- + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion != 'cancelled' + permissions: + actions: read + pull-requests: read + uses: alisw/ali-bot/.github/workflows/c++-code-formatting-cleanup-pr.yml@master + secrets: + alibuild_github_token: ${{ secrets.ALIBUILD_GITHUB_TOKEN }} diff --git a/.github/workflows/code-formatting.yml b/.github/workflows/code-formatting.yml index 9d1900983842d..8c6c46a2e86af 100644 --- a/.github/workflows/code-formatting.yml +++ b/.github/workflows/code-formatting.yml @@ -1,11 +1,11 @@ --- name: Formatting -'on': [pull_request_target] +'on': [pull_request] + +permissions: {} jobs: formatting: name: PR formatting uses: alisw/ali-bot/.github/workflows/c++-code-formatting.yml@master - secrets: - alibuild_github_token: ${{ secrets.ALIBUILD_GITHUB_TOKEN }}