[Sync] fetch-depth: 0 #9
This file contains 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: Symfony translations | |
on: | |
schedule: | |
- cron: '30 6,12,18 * * *' | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Sync | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} | |
repository: symfony/symfony | |
fetch-depth: 0 | |
- name: Get lowest version | |
id: version | |
run: | | |
set -x | |
version=$(curl -s https://symfony.com/releases.json | jq -r '.supported_versions[0]') | |
echo $version | |
echo "lowest_branch=$version" >> $GITHUB_OUTPUT | |
- name: Change branch | |
run: | | |
version=${{ steps.version.outputs.lowest_branch }} | |
git fetch origin $version | |
git checkout $version | |
- name: Download dependencies | |
run: | | |
cp composer.json composer.json.bak | |
composer config allow-plugins true | |
composer update --no-interaction --prefer-stable | |
rm composer.json | |
mv composer.json.bak composer.json | |
- name: Generate data files | |
id: generate_data | |
run: | | |
php .github/sync-translations.php | |
echo "This is debug code" > report.txt | |
date +%s >> report.txt | |
- name: Check for changes | |
id: check_changes | |
run: | | |
if [[ $(git diff --numstat | wc -l) -eq 0 ]]; then | |
echo "No significant changes." | |
echo "make_pr=false" >> $GITHUB_OUTPUT | |
exit 1 | |
fi | |
echo "make_pr=true" >> $GITHUB_OUTPUT | |
- name: Create Pull Request | |
if: ${{ steps.check_changes.outputs.make_pr == 'true' }} | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} | |
delete-branch: true | |
commit-message: Sync translations | |
branch: ${{ steps.version.outputs.lowest_branch }} | |
push-to-fork: carsonbot/symfony | |
title: 'Sync translations across all languages' | |
body: | | |
We just added new English translations. This PR make sure to add them to all other languages. |