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