update localize workflow
- fix git diff comparison - add current date to created PR
This commit is contained in:
parent
83c8a460e1
commit
88d67277f6
1 changed files with 8 additions and 5 deletions
13
.github/workflows/localize.yml
vendored
13
.github/workflows/localize.yml
vendored
|
|
@ -62,17 +62,20 @@ jobs:
|
||||||
# print the git diff
|
# print the git diff
|
||||||
git diff locale/sunshine.po
|
git diff locale/sunshine.po
|
||||||
|
|
||||||
# set the variable with minimal output
|
# set the variable with minimal output, replacing `\t` with ` `
|
||||||
OUTPUT=$(git diff --numstat locale/sunshine.po)
|
OUTPUT=$(git diff --numstat locale/sunshine.po | sed -e "s#\t# #g")
|
||||||
echo "git_diff=${OUTPUT}" >> $GITHUB_ENV
|
echo "git_diff=${OUTPUT}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: git reset
|
- name: git reset
|
||||||
# only run if a single line changed (date/time) and file already existed
|
# only run if a single line changed (date/time) and file already existed
|
||||||
# \t in next line is a tab character
|
if: ${{ env.git_diff == '1 1 locale/sunshine.po' && env.new_file == 'false' }}
|
||||||
if: ${{ env.git_diff == '1\t1\tlocale/sunshine.po' && env.new_file == 'false' }}
|
|
||||||
run: |
|
run: |
|
||||||
git reset --hard
|
git reset --hard
|
||||||
|
|
||||||
|
- name: Get current date
|
||||||
|
id: date
|
||||||
|
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Create/Update Pull Request
|
- name: Create/Update Pull Request
|
||||||
uses: peter-evans/create-pull-request@v4
|
uses: peter-evans/create-pull-request@v4
|
||||||
with:
|
with:
|
||||||
|
|
@ -86,7 +89,7 @@ jobs:
|
||||||
title: New Babel Updates
|
title: New Babel Updates
|
||||||
body: |
|
body: |
|
||||||
Update report
|
Update report
|
||||||
- Updated with *today's* date
|
- Updated ${{ steps.date.outputs.date }}
|
||||||
- Auto-generated by [create-pull-request][1]
|
- Auto-generated by [create-pull-request][1]
|
||||||
|
|
||||||
[1]: https://github.com/peter-evans/create-pull-request
|
[1]: https://github.com/peter-evans/create-pull-request
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue