chore(i18n,learn): processed translations #35
Workflow file for this run
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: Merge curriculum updates and update i18n-curriculum submodule | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
paths: | |
- curriculum/** | |
env: | |
GITHUB_TOKEN: ${{ secrets.CROWDIN_CAMPERBOT_PAT }} | |
GH_TOKEN: ${{ secrets.CROWDIN_CAMPERBOT_PAT }} | |
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_CAMPERBOT_SERVICE_TOKEN }} | |
CROWDIN_API_URL: 'https://freecodecamp.crowdin.com/api/v2/' | |
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID_CURRICULUM }} | |
jobs: | |
auto-merge: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Source Files | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
sparse-checkout: "." | |
- name: Merge PR | |
run: | | |
if [ -z "${GH_TOKEN}" ]; then | |
echo "GH_TOKEN is not set. Exiting gracefully." | |
exit 0 | |
fi | |
pr_user=$(gh pr view ${{ github.event.pull_request.number }} --json author --jq '.author.login') | |
if [ "$pr_user" = "camperbot" ]; then | |
gh pr merge ${{ github.event.pull_request.number }} --squash | |
else | |
echo "PR author is not camperbot" | |
exit 1 | |
fi | |
update-i18n-curriculum-submodule: | |
# Now that the curriculum has been updated, we can update the | |
# i18n-curriculum submodule in the freeCodeCamp repository | |
name: Update i18n-curriculum Submodule | |
needs: auto-merge | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout Source Files | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
repository: "freeCodeCamp/freeCodeCamp" | |
token: ${{ secrets.CROWDIN_CAMPERBOT_PAT }} | |
submodules: true | |
- name: Ensure correct submodule path and initialization | |
run: | | |
git submodule sync | |
git submodule update --init --recursive | |
- name: Update submodule | |
run: | | |
git config --global user.email "${{ secrets.ACTIONS_CAMPERBOT_EMAIL }}" | |
git config --global user.name "camperbot" | |
git checkout -b chore/update-i18n-curriculum-submodule | |
git submodule update --remote curriculum/i18n-curriculum | |
cd curriculum/i18n-curriculum && SUBMODULE_HASH=$(git rev-parse --short HEAD) && cd ../.. | |
git add . | |
git commit -m "chore(curriculum): Update i18n-curriculum submodule to $SUBMODULE_HASH" | |
git push -u origin chore/update-i18n-curriculum-submodule -f | |
- name: Create PR | |
uses: freecodecamp/crowdin-action@main | |
env: | |
PLUGIN: "pull-request" | |
GH_TOKEN: ${{ secrets.CROWDIN_CAMPERBOT_PAT }} | |
BRANCH: "chore/update-i18n-curriculum-submodule" | |
REPOSITORY: "freeCodeCamp/freeCodeCamp" | |
BASE: "main" | |
TITLE: "chore(i18n,learn): update i18n-curriculum submodule" | |
BODY: "This PR was opened auto-magically by camperbot." |