Open AdisonCavani opened 1 year ago
Did you figure this out? I'm looking for the same thing.
I would love to know as well how I can add the version to the PR title
I have a customized hack for it. There is a PR somewhere here for adding a --dry-run flag which should solve this. Anyway, here's my hack;
release-helper.js
const config = require('./release.json');
const {unlink} = require('fs')
const commit_message = `v${config.releases[0].newVersion} of ${config.releases[0].name}`
unlink('./release.json', () => {})
console.log(commit_message)
steps:
...
- name: Prep commit message
id: prep_commit_message
run: |
MESSAGE=$(pnpm changeset status --output=./release.json && node release-helper.js | tail -n 1)
echo "message=${MESSAGE}" >> $GITHUB_OUTPUT
steps:
...
- name: Create Release Pull Request
uses: changesets/action@v1
with:
title: ${{ steps.prep_commit_message.outputs.message }}
commit: "release version ${{ steps.prep_commit_message.outputs.message }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
This stuff can possibly be knocked out with a one liner using jq
. Just didn't want to jump through the hoops until the solution works over some time.
Incase you are ever interested in the jq version - @r115
It creates a release.json file temporarily extracts the version using jq and then removes the file (this is due to an outstanding feature request https://github.com/changesets/changesets/issues/1020)
steps:
...
- name: Prep commit message
run: |
echo "NEW_VERSION=$(pnpm changeset status --output=release.json && jq -r '.releases[0].newVersion' release.json && rm release.json)" >> "$GITHUB_ENV"
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
title: "Release v${{env.NEW_VERSION}}"
commit: "Release v${{env.NEW_VERSION}}"
publish: pnpm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
@hollandjake this is excellent, thanks
I'd like to get a customized Pull request title / commit message like this:
release: v0.0.1
.I know there is ability to customize the title:
But I want to also get a tag name, so the naming in more specific. Is this possible?