|
48 | 48 | id: set_program
|
49 | 49 | run: |
|
50 | 50 | echo program="core" >> $GITHUB_OUTPUT
|
51 |
| - if [[ "${{ inputs.git_ref }}" =~ ^release/mpl-core@* ]]; then |
| 51 | + if [[ "${{ inputs.git_ref }}" =~ ^release/core@* ]]; then |
52 | 52 | echo type="release" >> $GITHUB_OUTPUT
|
53 | 53 | else
|
54 | 54 | echo type="ref" >> $GITHUB_OUTPUT
|
|
96 | 96 | uses: actions/checkout@v4
|
97 | 97 | with:
|
98 | 98 | token: ${{ secrets.SVC_TOKEN }}
|
| 99 | + ref: ${{ inputs.git_ref }} |
99 | 100 |
|
100 | 101 | - name: Load environment variables
|
101 | 102 | run: cat .github/.env >> $GITHUB_ENV
|
@@ -252,9 +253,21 @@ jobs:
|
252 | 253 | name: 'Deploy ${{ inputs.git_ref }}}'
|
253 | 254 | keypair: ${{ env.SQUADS_BOT_KEY }}
|
254 | 255 |
|
255 |
| - - name: Commit and tag new version |
256 |
| - uses: stefanzweifel/git-auto-commit-action@v4 |
257 |
| - if: github.event.inputs.version_program == 'true' && github.event.inputs.cluster == 'mainnet-beta' |
| 256 | + - name: Create env tag |
| 257 | + uses: actions/github-script@v5 |
258 | 258 | with:
|
259 |
| - commit_message: Deploy mpl-${{ inputs.program }} program v${{ env.PROGRAM_VERSION }} |
260 |
| - tagging_message: mpl-${{ inputs.program }}@v${{ env.PROGRAM_VERSION }} |
| 259 | + script: | |
| 260 | + const refData = await github.rest.git.getRef({ |
| 261 | + owner: context.repo.owner, |
| 262 | + repo: context.repo.repo, |
| 263 | + ref: 'tags/${{ inputs.git_ref }}' |
| 264 | + }); |
| 265 | + if (refData.status !== 200) { |
| 266 | + throw new Error('Failed to fetch existing tag'); |
| 267 | + } |
| 268 | + github.rest.git.createRef({ |
| 269 | + owner: context.repo.owner, |
| 270 | + repo: context.repo.repo, |
| 271 | + ref: 'refs/tags/${{ needs.check_tag.outputs.program }}-${{ inputs.cluster }}', |
| 272 | + sha: refData.data.object.sha |
| 273 | + }); |
0 commit comments