Fix localize git diff and git reset steps
This commit is contained in:
parent
521335c387
commit
b286c06144
1 changed files with 7 additions and 3 deletions
10
.github/workflows/localize.yml
vendored
10
.github/workflows/localize.yml
vendored
|
|
@ -4,6 +4,7 @@ on:
|
||||||
push:
|
push:
|
||||||
branches: [nightly]
|
branches: [nightly]
|
||||||
paths: # prevents workflow from running unless these files change
|
paths: # prevents workflow from running unless these files change
|
||||||
|
- '.github/workflows/localize.yml'
|
||||||
- 'sunshine/**'
|
- 'sunshine/**'
|
||||||
- 'locale/sunshine.po'
|
- 'locale/sunshine.po'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
@ -40,15 +41,18 @@ jobs:
|
||||||
|
|
||||||
- name: git diff
|
- name: git diff
|
||||||
run: |
|
run: |
|
||||||
|
# disable the pager
|
||||||
|
git config --global pager.diff false
|
||||||
|
|
||||||
# print the git diff
|
# print the git diff
|
||||||
git diff --exit-code locale/sunshine.po
|
git diff locale/sunshine.po
|
||||||
|
|
||||||
# set the variable with minimal output
|
# 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
|
echo "git_diff=${OUTPUT}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: git reset
|
- 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: |
|
run: |
|
||||||
git reset --hard
|
git reset --hard
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue