diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 09efb7c54..9ee18a645 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -183,38 +183,11 @@ jobs: GH_TOKEN: ${{ github.token }} - name: Create or update beta tag - uses: actions/github-script@v7 + uses: richardsimko/update-tag@v1 with: - script: | - const createReleaseTag = async (client, refInfo) => { - core.startGroup('Generating release tag'); - const friendlyTagName = refInfo.ref.substring(10); // 'refs/tags/latest' => 'latest' - core.info(`Attempting to create or update release tag "${friendlyTagName}"`); - - try { - await client.git.createRef(refInfo); - } catch (err) { - const existingTag = refInfo.ref.substring(5); // 'refs/tags/latest' => 'tags/latest' - core.info( - `Could not create new tag "${refInfo.ref}" (${err.message}) therefore updating existing tag "${existingTag}"`, - ); - await client.git.updateRef({ - ...refInfo, - ref: existingTag, - force: true, - }); - } - - core.info(`Successfully created or updated the release tag "${friendlyTagName}"`); - core.endGroup(); - }; - - await createReleaseTag(github.rest, { - owner: context.repo.owner, - ref: 'refs/tags/beta', - repo: context.repo.repo, - sha: context.sha, - }); + tag_name: beta + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Publish Pre-Release uses: ncipollo/release-action@v1