Skip to content

Commit

Permalink
Support self-hosted runner that does not set GITHUB_OUTPUT
Browse files Browse the repository at this point in the history
Fixes #17
  • Loading branch information
taiki-e committed Dec 24, 2022
1 parent 715e1b4 commit 4466cb6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com

## [Unreleased]

- Support self-hosted runner that does not set `GITHUB_OUTPUT` environment variable. ([#17](https://github.com/taiki-e/create-gh-release-action/pull/17))

## [1.6.1] - 2022-10-14

- Fix invalid version format check introduced in 1.4.0.
Expand Down
13 changes: 10 additions & 3 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,14 @@ fi
# https://cli.github.com/manual/gh_release_create
GITHUB_TOKEN="${token}" gh release create "${release_options[@]}" --title "${title}" --notes "${notes:-}"

# set (computed) prefix and version outputs for future step use
# Set (computed) prefix and version outputs for future step use.
computed_prefix=${tag%"${version}"}
echo "computed-prefix=${computed_prefix}" >>"${GITHUB_OUTPUT}"
echo "version=${version}" >>"${GITHUB_OUTPUT}"
if [[ -n "${GITHUB_OUTPUT:-}" ]]; then
echo "computed-prefix=${computed_prefix}" >>"${GITHUB_OUTPUT}"
echo "version=${version}" >>"${GITHUB_OUTPUT}"
else
# Self-hosted runner may not set GITHUB_OUTPUT.
warn "GITHUB_OUTPUT is not set; skip setting 'computed-prefix' and 'version' outputs"
echo "computed-prefix: ${computed_prefix}"
echo "version: ${version}"
fi

0 comments on commit 4466cb6

Please sign in to comment.