Create a PR with changes after importing strings #599
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: Create a PR with changes after importing strings | |
on: | |
schedule: | |
- cron: '0 11 * * 1-5' | |
jobs: | |
build: | |
runs-on: macos-11 | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: [3.9] | |
xcode: ["13.0"] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Select Xcode ${{ matrix.xcode }} | |
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Get the current date for PR title | |
run: echo "current_date=$(date +"%m-%d-%Y")" >> $GITHUB_ENV | |
- name: Run script to import strings | |
run: sh ./bootstrap.sh --importLocales | |
- name: Update new strings | |
run: |- | |
git diff || (git add Shared/*/*.lproj/* Shared/*.lproj/* WidgetKit/*.lproj/* Client/*/*.lproj/* Client/*.lproj/*) | |
git restore Client.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | |
committer: GitHub <[email protected]> | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: string-import-${{ env.current_date }} | |
title: "Localize [version] String import ${{ env.current_date }}" | |
branch: string-import-${{ env.current_date }} | |
body: "This (automated) PR import string changes" |