@@ -4,10 +4,10 @@ name: Manaul trigger with locales PR
44on :
55 workflow_dispatch :
66 inputs :
7- SYNC_TERMS :
8- description : ' Remove unused labels'
9- required : false
10- default : ' false'
7+ SYNC_TERMS :
8+ description : ' Remove unused labels'
9+ required : false
10+ default : ' false'
1111
1212jobs :
1313
@@ -37,13 +37,11 @@ jobs:
3737 echo "CURRENT_DATE=$(date +'%Y-%m-%d_%H:%M')" >> $GITHUB_ENV
3838 echo "SYNC_TERMS=${{ github.event.inputs.SYNC_TERMS }}" >> $GITHUB_ENV
3939 shell : bash
40-
41- POE_CHECK_UPDATE :
40+
41+ POE_SYNC_TERMS :
4242 runs-on : ubuntu-latest
4343 needs : [Setup]
44- if : needs.Setup.outputs.ENVIRONMENT == 'DEV'
45- outputs :
46- UPGRADE : ${{ env.UPGRADE }}
44+ if : needs.Setup.outputs.ENVIRONMENT == 'DEV' && needs.Setup.outputs.SYNC_TERMS == 'true'
4745 env :
4846 COMMIT_TO : ${{ needs.Setup.outputs.COMMIT_TO }}
4947 TEMP_BRANCH : ${{ needs.Setup.outputs.TEMP_BRANCH }}
5654
5755 - name : Sync terms from PL file
5856 run : |
59- sh locales/scripts/sync_terms.sh -i ${{ secrets.POEDITOR_ID }} -t ${{ secrets.POEDITOR_TOKEN }} -o locales
60- if : env.SYNC_TERMS == 'true'
57+ sh locales/scripts/sync_terms.sh -i ${{ secrets.POEDITOR_ID }} -t ${{ secrets.POEDITOR_TOKEN }} -o locales
58+
59+ POE_CHECK_UPDATE :
60+ runs-on : ubuntu-latest
61+ needs : [Setup]
62+ if : needs.Setup.outputs.ENVIRONMENT == 'DEV' && needs.Setup.outputs.SYNC_TERMS == 'false'
63+ outputs :
64+ UPGRADE : ${{ env.UPGRADE }}
65+ env :
66+ COMMIT_TO : ${{ needs.Setup.outputs.COMMIT_TO }}
67+ TEMP_BRANCH : ${{ needs.Setup.outputs.TEMP_BRANCH }}
68+ SYNC_TERMS : ${{ needs.Setup.outputs.SYNC_TERMS }}
69+ steps :
70+ - name : Checkout Repo
71+ uses : actions/checkout@v2
72+ with :
73+ ref : ${{ env.COMMIT_TO }}
6174
6275 - name : Download REMOTE LOCALES from POEditor
6376 run : |
6679 echo "Processing $l"
6780 mv locales/$l.json /tmp/
6881 sh locales/scripts/export.sh -i ${{ secrets.POEDITOR_ID }} -t ${{ secrets.POEDITOR_TOKEN }} -l $l
82+ python3 locales/scripts/format_checker.py $l
6983 if ! diff -q locales/$l.json /tmp/$l.json 2>/dev/null
7084 then
7185 echo "UPGRADE=true" >> $GITHUB_ENV
91105 POE_MAKE_PR :
92106 runs-on : ubuntu-latest
93107 needs : [Setup,POE_CHECK_UPDATE]
94- if : needs.Setup.outputs.ENVIRONMENT == 'DEV' && needs.POE_CHECK_UPDATE.outputs.UPGRADE == 'true'
108+ if : needs.Setup.outputs.ENVIRONMENT == 'DEV' && needs.Setup.outputs.SYNC_TERMS == 'false' && needs.POE_CHECK_UPDATE.outputs.UPGRADE == 'true'
95109 env :
96110 COMMIT_TO : ${{ needs.Setup.outputs.COMMIT_TO }}
97111 TEMP_BRANCH : ${{ needs.Setup.outputs.TEMP_BRANCH }}
0 commit comments