From e4d7796d531c45ae3dcc5620bdace3c0975c63d3 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 16:54:48 +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 | 4 +--- 2 files changed, 22 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 00000000000..4a08127469c --- /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 d3e0bb47650..8c6c46a2e86 100644 --- a/.github/workflows/code-formatting.yml +++ b/.github/workflows/code-formatting.yml @@ -1,7 +1,7 @@ --- name: Formatting -'on': [pull_request_target] +'on': [pull_request] permissions: {} @@ -9,5 +9,3 @@ jobs: formatting: name: PR formatting uses: alisw/ali-bot/.github/workflows/c++-code-formatting.yml@master - secrets: - alibuild_github_token: ${{ secrets.ALIBUILD_GITHUB_TOKEN }}