File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -140,15 +140,12 @@ jobs:
140140 environment : production
141141 steps :
142142 - name : Send repository dispatch
143- uses : peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
144- with :
145- token : ${{ secrets.GITOPS_PAT }}
146- repository : openshock/kubernetes-cluster-gitops
147- event-type : update-backend-prod
148- client-payload : |
149- {
150- "tag": "${{ inputs.tag-prefix || 'rn' }}-${{ github.run_number }}-a${{ github.run_attempt }}"
151- }
143+ env :
144+ GH_TOKEN : ${{ secrets.GITOPS_PAT }}
145+ run : |
146+ gh api repos/openshock/kubernetes-cluster-gitops/dispatches \
147+ -f event_type=update-backend-prod \
148+ -F "client_payload[tag]=${{ inputs.tag-prefix || 'rn' }}-${{ github.run_number }}-a${{ github.run_attempt }}"
152149
153150 deploy-staging :
154151 runs-on : ubuntu-latest
@@ -158,15 +155,12 @@ jobs:
158155
159156 steps :
160157 - name : Send repository dispatch
161- uses : peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
162- with :
163- token : ${{ secrets.GITOPS_PAT }}
164- repository : openshock/kubernetes-cluster-gitops
165- event-type : update-backend-staging
166- client-payload : |
167- {
168- "tag": "${{ inputs.tag-prefix || 'rn' }}-${{ github.run_number }}-a${{ github.run_attempt }}"
169- }
158+ env :
159+ GH_TOKEN : ${{ secrets.GITOPS_PAT }}
160+ run : |
161+ gh api repos/openshock/kubernetes-cluster-gitops/dispatches \
162+ -f event_type=update-backend-staging \
163+ -F "client_payload[tag]=${{ inputs.tag-prefix || 'rn' }}-${{ github.run_number }}-a${{ github.run_attempt }}"
170164
171165 deploy-dev :
172166 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change @@ -21,11 +21,12 @@ jobs:
2121 steps :
2222 - name : Find latest tag
2323 id : latest-tag
24- uses : oprypin/find-latest-tag@6957ac556fa6d349727ecabfcaaf9f8e5ee37124 # v1.1.3
25- with :
26- repository : ${{ github.repository }}
27- regex : ' ^\d+\.\d+\.\d+$'
28- releases-only : false
24+ env :
25+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
26+ run : |
27+ tag=$(gh api "repos/${{ github.repository }}/tags" --paginate --jq '.[].name' \
28+ | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -1)
29+ echo "tag=$tag" >> "$GITHUB_OUTPUT"
2930
3031 # Delegate building and containerizing to a single workflow.
3132 build-and-containerize :
You can’t perform that action at this time.
0 commit comments