Use _set_github_output in Action

This commit is contained in:
Stefan Zweifel 2022-12-22 14:43:15 +01:00
parent b7a3dd9b3f
commit 2996cba0f1
1 changed files with 4 additions and 31 deletions

View File

@ -26,13 +26,7 @@ _main() {
if _git_is_dirty || "$INPUT_SKIP_DIRTY_CHECK"; then
# Check if $GITHUB_OUTPUT is available
# (Feature detection will be removed in late December 2022)
if [ -z ${GITHUB_OUTPUT+x} ]; then
echo "::set-output name=changes_detected::true";
else
echo "changes_detected=true" >> $GITHUB_OUTPUT;
fi
_set_github_output "changes_detected" "true"
_switch_to_branch
@ -49,26 +43,12 @@ _main() {
_push_to_github
else
# Check if $GITHUB_OUTPUT is available
# (Feature detection will be removed in late December 2022)
if [ -z ${GITHUB_OUTPUT+x} ]; then
echo "::set-output name=changes_detected::false";
else
echo "changes_detected=false" >> $GITHUB_OUTPUT;
fi
_set_github_output "changes_detected" "false"
echo "Working tree clean. Nothing to commit.";
fi
else
# Check if $GITHUB_OUTPUT is available
# (Feature detection will be removed in late December 2022)
if [ -z ${GITHUB_OUTPUT+x} ]; then
echo "::set-output name=changes_detected::false";
else
echo "changes_detected=false" >> $GITHUB_OUTPUT;
fi
_set_github_output "changes_detected" "false"
echo "Working tree clean. Nothing to commit.";
fi
@ -153,14 +133,7 @@ _local_commit() {
--author="$INPUT_COMMIT_AUTHOR" \
${INPUT_COMMIT_OPTIONS:+"${INPUT_COMMIT_OPTIONS_ARRAY[@]}"};
# Check if $GITHUB_OUTPUT is available
# (Feature detection will be removed in late December 2022)
if [ -z ${GITHUB_OUTPUT+x} ]; then
echo "::set-output name=commit_hash::$(git rev-parse HEAD)";
else
echo "commit_hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT;
fi
_set_github_output "commit_hash" $(git rev-parse HEAD)
}
_tag_commit() {