Skip to content

Commit 8cd905d

Browse files
authored
fix: incorrect Circle CI secret env name (#660)
Corrected the wrong Circle CI env variable name `CIRCLE_CI_API_TOKEN` -> `CIRCLECI_API_TOKEN`
1 parent 9e70471 commit 8cd905d

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

.github/workflows/release-ticket-creation.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,36 @@ on:
33
workflow_dispatch:
44
inputs:
55
branch_name:
6-
description: 'Release target branch name'
6+
description: 'Type a branch name starting with `release/v`'
77
required: true
88

99
jobs:
1010
trigger-release-ticket-creation:
1111
name: Trigger release ticket creation
1212
runs-on: ubuntu-latest
13-
# The branch name should starts with 'release/v'
14-
if: startsWith(github.event.inputs.branch_name, 'release/v')
1513
steps:
1614
- name: Checkout repository
1715
uses: actions/checkout@v2
16+
17+
- name: Verify branch name
18+
run: |
19+
if [[ ! ${{ github.event.inputs.branch_name }} =~ ^release/v ]]; then
20+
echo "Branch name should start with 'release/v'"
21+
exit 1
22+
fi
23+
1824
- name: Trigger CircleCI Job
1925
run: |
2026
API_RESULT=$(curl --request POST \
2127
--url "https://circleci.com/api/v2/project/gh/${{ github.repository }}/pipeline" \
22-
--header "Circle-Token: ${{ secrets.CIRCLE_CI_API_TOKEN }}" \
28+
--header "Circle-Token: ${{ secrets.CIRCLECI_API_TOKEN }}" \
2329
--header "content-type: application/json" \
2430
--data '{
2531
"branch": "${{ github.event.inputs.branch_name }}",
2632
"parameters": {
27-
"run_workflow_create_ticket": true,
33+
"run_workflow_create_ticket": true
2834
}
2935
}')
3036
echo "API_RESULT: ${API_RESULT}"
3137
CIRCLE_CI_JOB_NUMBER=$(echo "${API_RESULT}" | jq -r '.number')
3238
echo "::set-output name=DEPLOY_COMMENT_BODY::https://app.circleci.com/pipelines/github/${{ github.repository }}/$CIRCLE_CI_JOB_NUMBER"
33-
env:
34-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35-
CIRCLE_CI_API_TOKEN: ${{ secrets.CIRCLE_CI_API_TOKEN }}

0 commit comments

Comments
 (0)