diff --git a/.github/workflows/reset-on-merge.yml b/.github/workflows/reset-on-merge.yml index b36612c4fb0..bac70bf164b 100644 --- a/.github/workflows/reset-on-merge.yml +++ b/.github/workflows/reset-on-merge.yml @@ -25,9 +25,9 @@ jobs: - name: Tag the last head revision id: backup run: | - tag="${{ github.base_ref }}-backup-$(date +%Y%m%d%H%M%S)" + tag="${{ github.base_ref }}-backup-$(date +'%Y%m%d%H%M%S')" git tag "$tag" "$(git rev-parse HEAD~1)" - echo "tag=$tag" >> $GITHUB_OUTPUT + echo "tag=$tag" >> "$GITHUB_OUTPUT" - name: Push the tag uses: ad-m/github-push-action@master @@ -37,7 +37,9 @@ jobs: - name: Reset run: | - git reset --hard ${{ github.head_ref }} + git reset --hard "$rev" + env: + rev: ${{ github.head_ref }} - name: Push the resetted branch uses: ad-m/github-push-action@master