diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3a33284..5db2d80 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,12 +20,15 @@ jobs: # - https://stackoverflow.com/a/33733020 - name: Read git tag id: git-tag - run: echo "TAG_NAME=$(git tag --points-at HEAD)" >> $GITHUB_OUTPUT + run: | + echo "TAG_NAME=$(git tag --points-at HEAD)" >> $GITHUB_OUTPUT + echo "TEST=TESTTESTTEST" >> $GITHUB_OUTPUT # TODO: TESTING - name: Test git tag env: GIT_TAG: ${{ steps.git-tag.outputs.TAG_NAME }} + TEST: ${{ steps.git-tag.outputs.TEST }} if: contains(env.GIT_TAG, 'v') == false run: echo "Missing GIT_TAG; aborting" && exit 1 diff --git a/scripts/postversion-commit.js b/scripts/postversion-commit.js index 25bcf0e..d66cb7d 100644 --- a/scripts/postversion-commit.js +++ b/scripts/postversion-commit.js @@ -1,19 +1,17 @@ import {execSync} from 'node:child_process'; -import pkg from '../package.json' assert {type: 'json'}; /** * Utility for committing and tagging a release commit in * git, called as part of the `yarn postversion` script. */ -const currentBranch = execSync('git rev-parse --abbrev-ref HEAD') - .toString() - .trim(); +const branch = execSync('git rev-parse --abbrev-ref HEAD').toString().trim(); +const {version} = require('../package.json'); -if (currentBranch === 'main') { - execSync(`git checkout -b 'release/${pkg.version}'`); +if (branch === 'main') { + execSync(`git checkout -b 'release/${version}'`); } execSync('git add -u'); -execSync(`git commit -m 'chore(release): ${pkg.version}'`); -execSync(`git tag -a ${pkg.version} -m ${pkg.version}`); +execSync(`git commit -m 'chore(release): ${version}'`); +execSync(`git tag -a ${version} -m ${version}`);