Actions & PR Template verbessern #223

Merged
flixcoo merged 42 commits from setup/222-actions-&-pr-template-verbessern into development 2026-05-22 19:13:00 +00:00
2 changed files with 61 additions and 7 deletions
Showing only changes of commit 3a1092cf7d - Show all commits

View File

@@ -101,12 +101,65 @@ jobs:
echo "All messages translated."
sort_arb_files:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
# Required for Flutter action
- name: Install jq
run: |
apt-get update
apt-get install -y jq
# git fetch origin ${{ gitea.ref_name }}
# git checkout ${{ gitea.ref_name }}
# git pull origin ${{ gitea.ref_name }}
# git push origin HEAD:${{ gitea.ref_name }}
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.41.0
- name: Get dependencies
run: |
git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.41.0-x64
flutter pub get
- name: Sort .arb-Files
run: |
for file in lib/l10n/intl_*.arb; do
if [ -f "$file" ]; then
echo "Sorting $file"
dart run arb_utils sort $file
exit 1
fi
done
- name: Check for changes
id: check_changes
run: |
if [ -n "$(git status --porcelain lib/l10n/arb)" ]; then
echo "has_changes=true" >> "$GITHUB_OUTPUT"
else
echo "has_changes=false" >> "$GITHUB_OUTPUT"
fi
- name: Commit generated localizations
if: steps.check_changes.outputs.has_changes == 'true'
env:
GITEA_TOKEN: ${{ secrets.BOT_TOKEN }}
BRANCH_NAME: ${{ gitea.head_ref }}
run: |
git fetch origin "$BRANCH_NAME"
git checkout "$BRANCH_NAME"
if [ -n "$(git status --porcelain lib test)" ]; then
git config --global user.name "Gitea Actions [bot]"
git config --global user.email "actions@yannick-weigert.de"
git config pull.rebase false
git pull origin "$BRANCH_NAME"
git add lib/l10n
git commit -m "Generated localizations [skip ci]"
git push origin "HEAD:$BRANCH_NAME"
else
echo "No changes to commit"
fi

View File

@@ -32,6 +32,7 @@ dependencies:
uuid: ^4.5.2
dev_dependencies:
arb_utils: ^0.11.0
flutter_test:
sdk: flutter
build_runner: ^2.7.0