-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Read version from .version file and add get_release_notes
- Loading branch information
1 parent
baa3c8f
commit 7cb584b
Showing
5 changed files
with
86 additions
and
13 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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Return the release notes extracted from the PR body | ||
|
||
# | ||
# Returns the release notes from the content of a pull request linked to a release branch. It expects the branch name to be in the format release/vX.Y.Z, release/X.Y.Z, release/vX.Y.Z-beta.N. etc. | ||
# | ||
# TODO: Remove once the common repo is public. | ||
# | ||
inputs: | ||
version : | ||
required: true | ||
repo_name: | ||
required: false | ||
repo_owner: | ||
required: true | ||
token: | ||
required: true | ||
|
||
|
||
outputs: | ||
release_notes: | ||
value: ${{ steps.get_version.outputs.release_notes }} | ||
release_notes2: | ||
description: 'Release Notes' | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- id: get_release_notes | ||
shell: bash | ||
run: | | ||
RELEASE_PR_BRANCH="release/$VERSION" | ||
API_URL="https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/pulls" | ||
RELEASE_NOTES=$(curl -G \ | ||
-H "Accept: application/json" \ | ||
-H "Authorization: token $GITHUB_TOKEN" \ | ||
--data-urlencode "state=all" \ | ||
--data-urlencode "head=$REPO_OWNER:$RELEASE_PR_BRANCH" \ | ||
"$API_URL" | jq -r ".[0].body" | ||
) | ||
{ | ||
echo 'RELEASE_NOTES<<EOF' | ||
echo $RELEASE_NOTES | ||
echo 'EOF' | ||
} >> $GITHUB_ENV | ||
env: | ||
GITHUB_TOKEN: ${{ inputs.token }} | ||
REPO_OWNER: ${{ inputs.repo_owner }} | ||
REPO_NAME: ${{ inputs.repo_name }} | ||
VERSION: ${{ inputs.version }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
{ | ||
"files": { | ||
"src/version.ts": [], | ||
"README.md": ["{MAJOR}.{MINOR}"], | ||
"FAQ.md": ["{MAJOR}.{MINOR}.{PATCH}"] | ||
".version": [], | ||
"README.md": [ | ||
"{MAJOR}.{MINOR}" | ||
], | ||
"FAQ.md": [ | ||
"{MAJOR}.{MINOR}.{PATCH}" | ||
] | ||
}, | ||
"postbump": "npm run docs" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
v2.1.2 |