Skip to content

[Sync] Debug outputs #5

[Sync] Debug outputs

[Sync] Debug outputs #5

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: nyholm/symfony
- 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
echo "{lowest_branch}={$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: |
set -x
version=${{ steps.version.outputs.lowest_branch }}
echo $version
git checkout $version
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.