From b286c061449715aef215ad8b47d895bfe612ef2e Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 23 Apr 2022 20:50:42 -0400 Subject: [PATCH] Fix localize `git diff` and `git reset` steps --- .github/workflows/localize.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/localize.yml b/.github/workflows/localize.yml index b860ad64..a017efab 100644 --- a/.github/workflows/localize.yml +++ b/.github/workflows/localize.yml @@ -4,6 +4,7 @@ on: push: branches: [nightly] paths: # prevents workflow from running unless these files change + - '.github/workflows/localize.yml' - 'sunshine/**' - 'locale/sunshine.po' workflow_dispatch: @@ -40,15 +41,18 @@ jobs: - name: git diff run: | + # disable the pager + git config --global pager.diff false + # print the git diff - git diff --exit-code locale/sunshine.po + git diff locale/sunshine.po # set the variable with minimal output - OUTPUT=$(git diff --exit-code --numstat locale/sunshine.po) + OUTPUT=$(git diff --numstat locale/sunshine.po) echo "git_diff=${OUTPUT}" >> $GITHUB_ENV - name: git reset - if: ${{ env.git_diff != '1 1 locale/sunshine.po' }} # only run if more than 1 line changed + if: ${{ env.git_diff == '1 1 locale/sunshine.po' }} # only run if more than 1 line changed run: | git reset --hard