-
Notifications
You must be signed in to change notification settings - Fork 2.9k
63 lines (63 loc) · 2.49 KB
/
firefox-ios-import-strings.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Create a PR with changes after importing strings
on:
schedule:
- cron: '0 11 * * 1'
workflow_dispatch:
inputs:
branchName:
description: 'Branch used as target for automation'
required: true
default: 'main'
jobs:
build:
runs-on: macos-13
strategy:
max-parallel: 4
matrix:
python-version: [3.9]
xcode: ["14.3.1"]
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.event.inputs.branchName }}
- 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@v3
with:
python-version: ${{ matrix.python-version }}
- name: Get PR info
run: |
current_date=$(date +"%Y-%m-%d")
# Use 'main' when triggered via cron
current_branch=${{ github.event.inputs.branchName || 'main' }}
echo "current_date=$current_date" >> $GITHUB_ENV
if [[ $current_branch == 'main' ]]; then
echo "branch_name=string-import-$current_date" >> $GITHUB_ENV
echo "pr_title=Localize [ver] String import $current_date" >> $GITHUB_ENV
echo "pr_body=This automated PR imports string changes" >> $GITHUB_ENV
else
# version: v105.0 -> v105
version=${current_branch%??}
echo "branch_name=string-import-$current_branch-$current_date" >> $GITHUB_ENV
echo "pr_title=Localize [$version] String import $current_date" >> $GITHUB_ENV
echo "pr_body=This automated PR imports string changes into branch '$current_branch'" >> $GITHUB_ENV
fi
- 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@v4
with:
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
committer: GitHub <noreply@github.com>
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: ${{ env.pr_title }}
title: ${{ env.pr_title }}
branch: ${{ env.branch_name }}
body: ${{ env.pr_body }}