-
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #376 from mansona/update-release-plan
update release-plan (again)
- Loading branch information
Showing
5 changed files
with
129 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,10 @@ on: | |
branches: | ||
- main | ||
- master | ||
pull_request: | ||
pull_request_target: # This workflow has permissions on the repo, do NOT run code from PRs in this workflow. See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ | ||
types: | ||
- labeled | ||
- unlabeled | ||
|
||
concurrency: | ||
group: plan-release # only the latest one of these should ever be running | ||
|
@@ -41,40 +42,48 @@ jobs: | |
explanation: ${{ steps.explanation.outputs.text }} | ||
# only run on push event if plan wasn't updated (don't create a release plan when we're releasing) | ||
# only run on labeled event if the PR has already been merged | ||
if: (github.event_name == 'push' && needs.check-plan.outputs.command != 'release') || (github.event_name == 'pull_request' && github.event.pull_request.merged == true) | ||
if: (github.event_name == 'push' && needs.check-plan.outputs.command != 'release') || (github.event_name == 'pull_request_target' && github.event.pull_request.merged == true) | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
# We need to download lots of history so that | ||
# lerna-changelog can discover what's changed since the last release | ||
# github-changelog can discover what's changed since the last release | ||
with: | ||
fetch-depth: 0 | ||
ref: 'main' | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
|
||
- uses: pnpm/action-setup@v2 | ||
- uses: pnpm/action-setup@v3 | ||
with: | ||
version: 8 | ||
- run: pnpm install --frozen-lockfile | ||
|
||
- name: "Generate Explanation and Prep Changelogs" | ||
id: explanation | ||
run: | | ||
set -x | ||
pnpm release-plan prepare | ||
set +e | ||
pnpm release-plan prepare 2> >(tee -a release-plan-stderr.txt >&2) | ||
echo 'text<<EOF' >> $GITHUB_OUTPUT | ||
jq .description .release-plan.json -r >> $GITHUB_OUTPUT | ||
echo 'EOF' >> $GITHUB_OUTPUT | ||
if [ $? -ne 0 ]; then | ||
echo 'text<<EOF' >> $GITHUB_OUTPUT | ||
cat release-plan-stderr.txt >> $GITHUB_OUTPUT | ||
echo 'EOF' >> $GITHUB_OUTPUT | ||
else | ||
echo 'text<<EOF' >> $GITHUB_OUTPUT | ||
jq .description .release-plan.json -r >> $GITHUB_OUTPUT | ||
echo 'EOF' >> $GITHUB_OUTPUT | ||
rm release-plan-stderr.txt | ||
fi | ||
env: | ||
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: peter-evans/create-pull-request@v5 | ||
- uses: peter-evans/create-pull-request@v6 | ||
with: | ||
commit-message: "Prepare Release using 'release-plan'" | ||
author: "github-actions[bot] <[email protected]>" | ||
labels: "internal" | ||
branch: release-preview | ||
title: Prepare Release | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.