Skip to content

Commit 98f826b

Browse files
committed
update gh workflow
1 parent 12e5519 commit 98f826b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/newRelease.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
name: new Release
22
on:
3-
release:
4-
types: [created]
3+
push:
4+
tags:
5+
- v*
56

67
jobs:
78
build:
@@ -24,13 +25,15 @@ jobs:
2425
runs-on: ubuntu-latest
2526
needs: build
2627
steps:
28+
- name: Add TAG_NAME env property
29+
run: echo "TAG_NAME=`echo ${GITHUB_REF#refs/tags/}`" >> $GITHUB_ENV
2730
- name: Open PR in Environment Repository for new App Version
2831
env:
29-
ENV_REPO: gitops-tech/example-environment
32+
ENV_REPO: ${{ github.event.repository.owner.name }}/example-environment
3033
uses: benc-uk/[email protected]
3134
with:
3235
workflow: New Application Version
3336
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
34-
inputs: '{"tag_name": "${{ github.event.release.tag_name }}", "app_repo": "${{ github.event.repository.name }}", "image": "${{ github.event.repository.full_name }}:${{ github.event.release.tag_name }}"}'
35-
ref: refs/heads/master
37+
inputs: '{"tag_name": "${{ env.TAG_NAME }}", "app_repo": "${{ github.event.repository.name }}", "image": "${{ github.event.repository.full_name }}:${{ env.TAG_NAME }}"}'
38+
ref: refs/heads/main
3639
repo: ${{ env.ENV_REPO }}

0 commit comments

Comments
 (0)