Skip to content

Commit 46e60f3

Browse files
committed
ci: trigger correct branch for deployment
1 parent 507c98b commit 46e60f3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/latest.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,22 @@ jobs:
3838
needs: [ docker-latest ]
3939
runs-on: ubuntu-latest
4040
steps:
41+
42+
- name: Get current branch
43+
id: branch
44+
run: |
45+
echo "branch_name=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
46+
4147
- name: Trigger AWS Kubernetes deployment
4248
uses: actions/github-script@v6
49+
env:
50+
BRANCH: ${{ steps.branch.outputs.branch_name }}
4351
with:
4452
github-token: ${{ secrets.GITHUB_TOKEN }}
4553
script: |
4654
await github.rest.actions.createWorkflowDispatch({
4755
owner: context.repo.owner,
4856
repo: context.repo.repo,
4957
workflow_id: 'kubernetes-deploy-to-cluster.yml',
50-
ref: 'main'
58+
ref: process.env.BRANCH
5159
})

0 commit comments

Comments
 (0)