-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
104 additions
and
5 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
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 |
---|---|---|
|
@@ -22,6 +22,24 @@ inputs: | |
description: "Release-plz version to use. It must be an existing git tag name. For example `release-plz-v0.2.45`. (Default: `latest`)." | ||
default: "release-plz-v0.3.63" | ||
required: false | ||
outputs: | ||
# Useful for when https://github.com/MarcoIeni/release-plz/issues/1029 is implemented. | ||
# For now, it just returns an array with `pr` in it. | ||
prs: | ||
description: "The release PRs opened by release-plz. (Not useful for now. Use `pr` instead)" | ||
value: ${{ steps.release-plz.outputs.prs }} | ||
pr: | ||
description: "The release PR opened by release-plz." | ||
value: ${{ steps.release-plz.outputs.pr }} | ||
releases: | ||
description: "The JSON output of the `release` command." | ||
value: ${{ steps.release-plz.outputs.releases }} | ||
prs_created: | ||
description: "Whether release-plz created any release PR." | ||
value: ${{ steps.release-plz.outputs.prs_created }} | ||
releases_created: | ||
description: "Whether release-plz released any package." | ||
value: ${{ steps.release-plz.outputs.releases_created }} | ||
branding: | ||
icon: "zap" | ||
color: "yellow" | ||
|
@@ -43,6 +61,7 @@ runs: | |
- name: Configure git user from GitHub token | ||
uses: MarcoIeni/[email protected] | ||
- name: Run release-plz | ||
id: release-plz | ||
shell: bash | ||
run: | | ||
if [[ -n "${{ inputs.config }}" ]] | ||
|
@@ -75,20 +94,45 @@ runs: | |
if [[ -z "${{ inputs.command }}" || "${{ inputs.command }}" == "release-pr" ]] | ||
then | ||
echo "-- Running release-plz release-pr --" | ||
release-plz release-pr\ | ||
release_pr_output=$(release-plz release-pr\ | ||
--git-token ${GITHUB_TOKEN}\ | ||
--repo-url https://github.com/${GITHUB_REPOSITORY}\ | ||
${CONFIG_PATH}\ | ||
${ALT_REGISTRY}\ | ||
${MANIFEST_PATH} | ||
${MANIFEST_PATH}\ | ||
-o json) | ||
echo "release_pr_output: $release_pr_output" | ||
prs=$(echo $release_pr_output | jq -c .prs) | ||
echo "prs=$prs" >> "$GITHUB_OUTPUT" | ||
prs_length=$(echo "$prs" | jq 'length') | ||
if [ "$prs_length" != "0" ]; then | ||
prs_created=true | ||
first_pr=$(echo $prs | jq -c .[0]) | ||
else | ||
prs_created=false | ||
first_pr="{}" | ||
fi | ||
echo "pr=$first_pr" >> "$GITHUB_OUTPUT" | ||
echo "prs_created=$prs_created" >> "$GITHUB_OUTPUT" | ||
fi | ||
if [[ -z "${{ inputs.command }}" || "${{ inputs.command }}" == "release" ]] | ||
then | ||
echo "-- Running release-plz release --" | ||
release-plz release\ | ||
release_output=$(release-plz release\ | ||
--git-token ${GITHUB_TOKEN}\ | ||
${CONFIG_PATH}\ | ||
${ALT_REGISTRY}\ | ||
${MANIFEST_PATH} | ||
${MANIFEST_PATH}\ | ||
-o json) | ||
echo "release_output: $release_output" | ||
releases=$(echo $release_output | jq -c .releases) | ||
echo "releases=$releases" >> "$GITHUB_OUTPUT" | ||
releases_length=$(echo "$releases" | jq 'length') | ||
if [ "$releases_length" != "0" ]; then | ||
releases_created=true | ||
else | ||
releases_created=false | ||
fi | ||
echo "releases_created=$releases_created" >> "$GITHUB_OUTPUT" | ||
fi |