|
13 | 13 | steps: |
14 | 14 | - uses: actions/checkout@v4 |
15 | 15 |
|
| 16 | + - name: Add INPUT_SHA env var |
| 17 | + run: | |
| 18 | + export INPUT_SHA=$(git rev-parse ${{ github.event.inputs.ref }}) |
| 19 | + echo "INPUT_SHA=`echo $INPUT_SHA`" >> $GITHUB_ENV |
| 20 | +
|
16 | 21 | - name: Install Node ${{ env.NODE_VERSION }} |
17 | 22 | uses: actions/setup-node@v3 |
18 | 23 | with: |
@@ -67,18 +72,28 @@ jobs: |
67 | 72 | aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
68 | 73 | aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
69 | 74 |
|
70 | | - - name: Get the current release version |
| 75 | + - name: Get next release version |
71 | 76 | if: ${{ github.ref == 'refs/heads/master' }} |
72 | | - id: current-version |
73 | | - run: | |
74 | | - current_version=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name) |
75 | | - echo "Current version is $current_version" |
76 | | - echo "result=$current_version" >> $GITHUB_OUTPUT |
| 77 | + uses: actions/github-script@v7 |
| 78 | + id: next-version |
| 79 | + with: |
| 80 | + result-encoding: string |
| 81 | + script: | |
| 82 | + const getNextVersion = require('./.branch-github-actions/custom-scripts/next-version'); |
| 83 | + const nextVersion = await getNextVersion({ |
| 84 | + core, |
| 85 | + github, |
| 86 | + context, |
| 87 | + sha: process.env.INPUT_SHA, |
| 88 | + }); |
| 89 | + return nextVersion; |
| 90 | + env: |
| 91 | + INPUT_SHA: ${{ env.INPUT_SHA }} |
77 | 92 |
|
78 | 93 | - name: Write version to files |
79 | 94 | if: ${{ github.ref == 'refs/heads/master' }} |
80 | 95 | run: | |
81 | | - ./deployment/write-versions.sh ${{ steps.current-version.outputs.result }} |
| 96 | + ./deployment/write-versions.sh ${{ steps.next-version.outputs.result }} |
82 | 97 |
|
83 | 98 | - name: Deploy updated builds to staging |
84 | 99 | if: ${{ github.ref == 'refs/heads/master' }} |
|
0 commit comments