Skip to content

Commit

Permalink
chore(ci): Use conventional commit message for release PR (#91)
Browse files Browse the repository at this point in the history
* chore(ci): Use conventional commit message for release PR

* fix: Set correct PAT on PR
  • Loading branch information
KeithClinard authored Aug 23, 2024
1 parent f8b6471 commit 820d80b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .github/release-commit-message.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const fs = require('fs');

const releasePlan = fs.readFileSync('.release-plan.json', 'utf8');
const releasePlanJson = JSON.parse(releasePlan);

const newEmberVersion = releasePlanJson.solution['@nrg-ui/ember'].newVersion;
const newCssVersion = releasePlanJson.solution['@nrg-ui/css'].newVersion;

const updatedVersions = [];
if (newEmberVersion) {
updatedVersions.push(`@nrg-ui/ember@${newEmberVersion}`);
}
if (newCssVersion) {
updatedVersions.push(`@nrg-ui/css@${newCssVersion}`);
}

const commitMessage = `COMMIT_MESSAGE=release: ${updatedVersions.join(', ')}`;
console.log(commitMessage);
9 changes: 7 additions & 2 deletions .github/workflows/plan-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,17 @@ jobs:
env:
GITHUB_AUTH: ${{ secrets.RELEASE_PLAN_GH_TOKEN }}

- name: Generate commit message
run: node .github/release-commit-message.js >> "$GITHUB_OUTPUT"
id: commit-message

- uses: peter-evans/create-pull-request@v6
with:
commit-message: "Prepare Release using 'release-plan'"
commit-message: ${{ steps.commit-message.outputs.COMMIT_MESSAGE }}
labels: 'internal'
branch: release-preview
title: Prepare Release
title: ${{ steps.commit-message.outputs.COMMIT_MESSAGE }}
token: ${{ secrets.RELEASE_PLAN_GH_TOKEN }}
body: |
This PR is a preview of the release that [release-plan](https://github.com/embroider-build/release-plan) has prepared. To release you should just merge this PR 👍
Expand Down

0 comments on commit 820d80b

Please sign in to comment.