File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,27 +27,33 @@ jobs:
2727 runs-on : ubuntu-latest
2828 outputs :
2929 should_build : ${{ steps.check.outputs.should_build }}
30+ should_publish : ${{ steps.check.outputs.should_publish }}
3031 steps :
3132 - name : 检查
3233 id : check
3334 shell : bash
3435 run : |
3536 set -euo pipefail
3637 should_build="false"
38+ should_publish="false"
3739 if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
3840 should_build="true"
41+ should_publish="true"
3942 elif [ "${{ github.event_name }}" = "pull_request" ]; then
4043 should_build="true"
4144 elif [ "${{ github.event_name }}" = "push" ]; then
4245 if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
4346 should_build="true"
47+ should_publish="true"
4448 elif [ -n "${{ github.event.head_commit.message }}" ]; then
4549 if echo "${{ github.event.head_commit.message }}" | grep -q "开始构建"; then
4650 should_build="true"
51+ should_publish="true"
4752 fi
4853 fi
4954 fi
5055 echo "should_build=${should_build}" >> "$GITHUB_OUTPUT"
56+ echo "should_publish=${should_publish}" >> "$GITHUB_OUTPUT"
5157
5258 ci :
5359 name : 持续集成(${{ matrix.os }})
9399
94100 version :
95101 name : 解析版本
96- if : ${{ github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/v') }}
102+ needs : [check-trigger]
103+ if : needs.check-trigger.outputs.should_publish == 'true'
97104 runs-on : ubuntu-latest
98105 outputs :
99106 version : ${{ steps.v.outputs.version }}
You can’t perform that action at this time.
0 commit comments