File tree Expand file tree Collapse file tree 1 file changed +2
-23
lines changed
Expand file tree Collapse file tree 1 file changed +2
-23
lines changed Original file line number Diff line number Diff line change 11# This workflow automatically creates a test branch from a release tag
22# For example, when release v1.40.0 is published, it creates test-v1.40.0 branch
3- # Can also be triggered manually to create a test branch from any existing tag
43
54name : Create Test Branch from Release
65
76on :
87 release :
98 types : [published]
10- workflow_dispatch :
11- inputs :
12- tag_name :
13- description : ' Tag name to create test branch from (e.g., v1.40.0)'
14- required : true
15- type : string
16- test_branch_name :
17- description : ' Test branch name (optional, defaults to test-<tag_name>)'
18- required : false
19- type : string
209
2110permissions :
2211 contents : write
2918 - name : Extract tag name
3019 id : extract_tag
3120 run : |
32- # Determine tag name based on trigger type
33- if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
34- TAG_NAME=${{ inputs.tag_name }}
35- if [ -n "${{ inputs.test_branch_name }}" ]; then
36- TEST_BRANCH_NAME=${{ inputs.test_branch_name }}
37- else
38- TEST_BRANCH_NAME="test-${TAG_NAME}"
39- fi
40- else
41- TAG_NAME=${{ github.event.release.tag_name }}
42- TEST_BRANCH_NAME="test-${TAG_NAME}"
43- fi
21+ TAG_NAME=${{ github.event.release.tag_name }}
22+ TEST_BRANCH_NAME="test-${TAG_NAME}"
4423
4524 echo "tag_name=${TAG_NAME}" >> $GITHUB_OUTPUT
4625 echo "test_branch_name=${TEST_BRANCH_NAME}" >> $GITHUB_OUTPUT
You can’t perform that action at this time.
0 commit comments