mirror of
https://github.com/stefanzweifel/git-auto-commit-action.git
synced 2025-07-31 06:57:40 +08:00
Use deprecated set-output syntax if GITHUB_OUTPUT environment is not available (#255)
* Fallback to set-output if GITHUB_OUTPUT not available * Add Tests to cover old syntax
This commit is contained in:
@@ -11,7 +11,13 @@ _main() {
|
||||
|
||||
if _git_is_dirty || "$INPUT_SKIP_DIRTY_CHECK"; then
|
||||
|
||||
echo "changes_detected=true" >> $GITHUB_OUTPUT;
|
||||
# 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
|
||||
|
||||
_switch_to_branch
|
||||
|
||||
@@ -24,7 +30,13 @@ _main() {
|
||||
_push_to_github
|
||||
else
|
||||
|
||||
echo "changes_detected=false" >> $GITHUB_OUTPUT;
|
||||
# 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
|
||||
|
||||
echo "Working tree clean. Nothing to commit.";
|
||||
fi
|
||||
@@ -101,7 +113,14 @@ _local_commit() {
|
||||
--author="$INPUT_COMMIT_AUTHOR" \
|
||||
${INPUT_COMMIT_OPTIONS:+"${INPUT_COMMIT_OPTIONS_ARRAY[@]}"};
|
||||
|
||||
echo "commit_hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT;
|
||||
|
||||
# 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
|
||||
}
|
||||
|
||||
_tag_commit() {
|
||||
|
Reference in New Issue
Block a user