Skip to content

Commit f04f044

Browse files
authored
[Fix](auto-pick)Allow doris-robot to trigger the workflow (#43166)
### What problem does this PR solve? https://github.com/orgs/community/discussions/55906 Due to security restrictions, the GitHub Actions bot cannot trigger workflows directly. Instead, we use doris-robot to initiate other CI runs. Only automatically generated PRs will prompt doris-robot to comment, and we verify the author and content to determine whether a workflow should be triggered. This approach does not affect the original CI process; it simply adds an additional trigger condition. ### Check List (For Committer) - Test <!-- At least one of them must be included. --> - [ ] Regression test - [ ] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [x] No need to test or manual test. Explain why: - [x] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No colde files have been changed. - [ ] Other reason <!-- Add your reason? --> - Behavior changed: - [x] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [x] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> - Release note <!-- bugfix, feat, behavior changed need a release note --> <!-- Add one line release note for this PR. --> None ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
1 parent dbd490d commit f04f044

5 files changed

Lines changed: 50 additions & 3 deletions

File tree

‎.github/workflows/build-extension.yml‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ name: Build Extensions
2020

2121
on:
2222
pull_request:
23-
23+
workflow_dispatch:
24+
issue_comment:
25+
types: [ created ]
2426
concurrency:
2527
group: ${{ github.ref }} (Build Extensions)
2628
cancel-in-progress: true
@@ -29,6 +31,12 @@ jobs:
2931
changes:
3032
name: Detect Changes
3133
runs-on: ubuntu-latest
34+
if: |
35+
(github.event_name == 'pull_request') ||
36+
(github.event_name == 'issue_comment' &&
37+
github.event.comment.body == 'run buildall' &&
38+
github.actor == 'doris-robot' &&
39+
github.event.issue.user.login == 'github-actions[bot]')
3240
outputs:
3341
broker_changes: ${{ steps.filter.outputs.broker_changes }}
3442
docs_changes: ${{ steps.filter.outputs.docs_changes }}

‎.github/workflows/build-thirdparty.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ name: Build Third Party Libraries
1919

2020
on:
2121
pull_request:
22+
workflow_dispatch:
23+
issue_comment:
24+
types: [ created ]
2225

2326
concurrency:
2427
group: ${{ github.ref }} (Build Third Party Libraries)
@@ -28,6 +31,12 @@ jobs:
2831
changes:
2932
name: Detect Changes
3033
runs-on: ubuntu-latest
34+
if: |
35+
(github.event_name == 'pull_request') ||
36+
(github.event_name == 'issue_comment' &&
37+
github.event.comment.body == 'run buildall' &&
38+
github.actor == 'doris-robot' &&
39+
github.event.issue.user.login == 'github-actions[bot]')
3140
outputs:
3241
thirdparty_changes: ${{ steps.filter.outputs.thirdparty_changes }}
3342
steps:

‎.github/workflows/checkstyle.yaml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,20 @@ name: FE Code Style Checker
2020

2121
on:
2222
pull_request:
23+
workflow_dispatch:
24+
issue_comment:
25+
types: [ created ]
2326

2427
jobs:
2528
java-checkstyle:
2629
name: "CheckStyle"
2730
runs-on: ubuntu-latest
31+
if: |
32+
(github.event_name == 'pull_request') ||
33+
(github.event_name == 'issue_comment' &&
34+
github.event.comment.body == 'run buildall' &&
35+
github.actor == 'doris-robot' &&
36+
github.event.issue.user.login == 'github-actions[bot]')
2837
steps:
2938
- name: Checkout
3039
uses: actions/checkout@v3

‎.github/workflows/clang-format.yml‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,22 @@
1919
---
2020
name: Code Formatter
2121

22-
on: [push, pull_request_target]
23-
22+
on:
23+
pull_request:
24+
pull_request_target:
25+
workflow_dispatch:
26+
issue_comment:
27+
types: [ created ]
2428
jobs:
2529
clang-format:
2630
name: "Clang Formatter"
2731
runs-on: ubuntu-latest
32+
if: |
33+
(github.event_name == 'pull_request') || (github.event_name == 'pull_request_target') ||
34+
(github.event_name == 'issue_comment' &&
35+
github.event.comment.body == 'run buildall' &&
36+
github.actor == 'doris-robot' &&
37+
github.event.issue.user.login == 'github-actions[bot]')
2838
steps:
2939
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
3040
if: ${{ github.event_name != 'pull_request_target' }}

‎.github/workflows/license-eyes.yml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,21 @@ on:
2222
push:
2323
branches:
2424
- master
25+
workflow_dispatch:
26+
issue_comment:
27+
types: [ created ]
28+
2529
jobs:
2630
license-check:
2731
name: "License Check"
2832
runs-on: ubuntu-latest
33+
if: |
34+
(github.event_name == 'pull_request_target') ||
35+
(github.event_name == 'push' && github.ref == 'refs/heads/master') ||
36+
(github.event_name == 'issue_comment' &&
37+
github.event.comment.body == 'run buildall' &&
38+
github.actor == 'doris-robot' &&
39+
github.event.issue.user.login == 'github-actions[bot]')
2940
steps:
3041
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
3142
if: ${{ github.event_name != 'pull_request_target' }}

0 commit comments

Comments
 (0)