1+ # This is a basic workflow to help you get started with Actions
2+
3+ name : CI Request Trigger
4+
5+ # Controls when the workflow will run
6+ on :
7+ pull_request :
8+ branches : [ "master" ]
9+
10+ # Allows you to run this workflow manually from the Actions tab
11+ workflow_dispatch :
12+
13+ concurrency :
14+ group : ${{ github.workflow }}-${{ github.event.pull_request.number }}
15+ cancel-in-progress : true
16+
17+ # A workflow run is made up of one or more jobs that can run sequentially or in parallel
18+ jobs :
19+ # This workflow contains a single job called "build"
20+ build :
21+ # The type of runner that the job will run on
22+ runs-on : ubuntu-latest
23+ # work on CI script dir
24+ defaults :
25+ run :
26+ working-directory : .github/scripts
27+ # Steps represent a sequence of tasks that will be executed as part of the job
28+ steps :
29+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
30+ - uses : actions/checkout@v4
31+
32+ # Runs trigger CI
33+ - name : Make the script files executable
34+ run : chmod +x trigger-CI.sh get-CI-result.sh
35+ - name : trigger a CI
36+ run : |
37+ COMMIT_ID=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.event.pull_request.head.sha }}" || echo "${{ github.sha }}")
38+ echo "Using Commit ID: $COMMIT_ID"
39+ echo "$GITHUB_REF"
40+ PR_ID=$(echo "$GITHUB_REF" | sed 's@refs/pull/\([0-9]\+\)/.*@\1@')
41+ echo "PR ID is $PR_ID"
42+ ./trigger-CI.sh "$COMMIT_ID" "${{ secrets.CI_SECRET }}" "${{ github.event.pull_request.head.repo.clone_url }}" "$PR_ID"
43+
44+ # Runs get CI result
45+ - name : Get CI result
46+ run : |
47+ COMMIT_ID=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.event.pull_request.head.sha }}" || echo "${{ github.sha }}")
48+ echo "Using Commit ID: $COMMIT_ID"
49+ ./get-CI-result.sh "$COMMIT_ID" "${{ secrets.CI_SECRET }}"
50+ /Volumes/work/github/guojForkAlibaba/ROCK/.github/workflows/CI-request-trigger.yml
0 commit comments