forked from stellar/stellar-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (48 loc) · 1.61 KB
/
copy-workflow.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
name: Crowdin Copy and Create PR
on:
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
crowdin_copy_and_pr:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install dependencies
run: yarn install
- name: Run crowdin:copy
run: yarn run crowdin:copy
- name: Configure Git
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
- name: Check for changes
id: changes
run: |
if git diff --quiet; then
echo "::set-output name=changes::false"
else
echo "::set-output name=changes::true"
fi
- name: Create and push changes to new branch
if: steps.changes.outputs.changes == 'true'
run: |
git checkout -b crowdin-copy-changes
git add .
git commit -m "chore: Copy ignored files using crowdin:copy"
git push --set-upstream origin crowdin-copy-changes
- name: Create Pull Request
if: steps.changes.outputs.changes == 'true'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: crowdin-copy-changes
title: "Copy ignored files using crowdin:copy"
body: "This PR was created by GitHub Actions to copy ignored files using the crowdin:copy command."
labels: "automation"