Skip to content

Commit

Permalink
fix: Port from set-output to environment files
Browse files Browse the repository at this point in the history
GitHub deprecated the set-output command, and recommends using the new
environment files instead for security purposes.
  • Loading branch information
Kurt-von-Laven committed Oct 18, 2022
1 parent 2780e02 commit 315d790
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
run: |
COMMIT_ID="$(git rev-parse "${{ github.head_ref }}")"
echo "The sha of the starting commit is $COMMIT_ID"
echo "::set-output name=commit::$COMMIT_ID"
echo "SHA=$COMMIT_ID" >>"$GITHUB_OUTPUT"
- name: create test commit
run: |
touch test_file
Expand All @@ -43,7 +43,7 @@ jobs:
cd new_head
last_pushed_commit="$(git rev-parse "${{ github.head_ref }}")"
echo "Commit sha on origin: $last_pushed_commit"
if [[ $last_pushed_commit != ${{ steps.capture.outputs.commit }} ]]; then
if [[ $last_pushed_commit != ${{ steps.capture.outputs.SHA }} ]]; then
echo "Something got pushed to ${{ github.head_ref }}"
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ if [[ $REV == "$PREV_REV" ]]; then
INPUT_PUSH='false'
fi
echo "REVISION=${REV}" >>"$GITHUB_ENV"
echo "::set-output name=version::${REV}"
echo "version=${REV}" >>"$GITHUB_OUTPUT"

CURRENT_BRANCH="$(git branch --show-current)"
INPUT_BRANCH="${INPUT_BRANCH:-$CURRENT_BRANCH}"
Expand Down

0 comments on commit 315d790

Please sign in to comment.