Raffael Meyer | f44a841 | 2024-03-05 13:36:31 +0100 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | set -e |
| 3 | cd ~ || exit |
| 4 | |
| 5 | echo "Setting Up Bench..." |
| 6 | |
| 7 | pip install frappe-bench |
| 8 | bench -v init frappe-bench --skip-assets --skip-redis-config-generation --python "$(which python)" |
| 9 | cd ./frappe-bench || exit |
| 10 | |
| 11 | echo "Get ERPNext..." |
| 12 | bench get-app --skip-assets erpnext "${GITHUB_WORKSPACE}" |
| 13 | |
| 14 | echo "Generating POT file..." |
| 15 | bench generate-pot-file --app erpnext |
| 16 | |
| 17 | cd ./apps/erpnext || exit |
| 18 | |
| 19 | echo "Configuring git user..." |
| 20 | git config user.email "developers@erpnext.com" |
| 21 | git config user.name "frappe-pr-bot" |
| 22 | |
| 23 | echo "Setting the correct git remote..." |
| 24 | # Here, the git remote is a local file path by default. Let's change it to the upstream repo. |
| 25 | git remote set-url upstream https://github.com/frappe/erpnext.git |
| 26 | |
| 27 | echo "Creating a new branch..." |
| 28 | isodate=$(date -u +"%Y-%m-%d") |
| 29 | branch_name="pot_${BASE_BRANCH}_${isodate}" |
| 30 | git checkout -b "${branch_name}" |
| 31 | |
| 32 | echo "Commiting changes..." |
| 33 | git add . |
| 34 | git commit -m "chore: update POT file" |
| 35 | |
| 36 | gh auth setup-git |
| 37 | git push -u upstream "${branch_name}" |
| 38 | |
| 39 | echo "Creating a PR..." |
| 40 | gh pr create --fill --base "${BASE_BRANCH}" --head "${branch_name}" -R frappe/erpnext |