Merge branch 'main' of github.com:stellar/stellar-docs into lucasgil-… #24
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: Crowdin Copy and Create PR | |
on: | |
workflow_dispatch: | |
push: | |
paths: [ 'docs/**', 'platforms/**','i18n/en/**', 'src/pages/**', 'meeting-notes/**' ] | |
branches: [ main ] | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
crowdin_copy_and_pr: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout main branch | |
uses: actions/checkout@v3 | |
with: | |
ref: main | |
- name: Merge latest changes from origin/main | |
run: | | |
git fetch origin | |
git checkout main | |
git merge origin/main | |
- 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 "changes=false" >> $GITHUB_OUTPUT | |
else | |
echo "changes=true" >> $GITHUB_OUTPUT | |
fi | |
- name: Create and push changes to branch | |
if: steps.changes.outputs.changes == 'true' | |
run: | | |
BRANCH_NAME="crowdin-copy-changes" | |
git push origin --delete $BRANCH_NAME || true | |
git checkout -b $BRANCH_NAME | |
git add . | |
git commit -m "chore: Copy ignored files using crowdin:copy" | |
git push --force --set-upstream origin $BRANCH_NAME | |
echo "branch_name=$BRANCH_NAME" >> $GITHUB_ENV | |
- name: Install GitHub CLI | |
if: steps.changes.outputs.changes == 'true' | |
run: sudo apt-get install -y gh | |
- name: Create Pull Request | |
if: steps.changes.outputs.changes == 'true' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh pr create --repo ${{ github.repository }} --base main --head ${{ env.branch_name }} --title "Copy ignored files using crowdin:copy" --body "This PR was created by GitHub Actions to copy ignored files using the crowdin:copy command." |