fix: android app label #242
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Validazione File Domande | |
| on: | |
| push: | |
| branches: | |
| - main | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| Validazione-File-Domande: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v2 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - run: cd ${{ github.workspace }} | |
| - name: Controllo Codifica File | |
| run: | | |
| file_domande="Domande.txt" | |
| codifica="UTF-8" | |
| # Check Encoding | |
| charset=$(file -i "$file_domande" | cut -f 2 -d ";" | cut -f 2 -d "=") | |
| if [[ "${charset^^}" = "$codifica" ]] | |
| then | |
| echo "✔️ DEUBG: Codifica OK ($charset)" | |
| cp "$file_domande" "app-desktop/Domande.txt" | |
| cp "$file_domande" "app-mobile/flutter_application/assets/domande.txt" | |
| # Check if there are changes | |
| if [[ -n $(git status -s) ]] | |
| then | |
| # Commit & Push changes | |
| git add -f "app-desktop/Domande.txt" | |
| git add -f "app-mobile/flutter_application/assets/domande.txt" | |
| git config --global user.email "righi.michele98@gmail.com" | |
| git config --global user.name "mikyll" | |
| git commit -m "fix: update questions file" | |
| git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
| echo "✔️ File domande aggiornati!" | |
| else | |
| echo "Nessuna modifica necessaria." | |
| fi | |
| else | |
| echo "❌ ERRORE: Codifica file \"$file_domande\" errata ($charset)" | |
| exit 1 | |
| fi |