-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from alchem0x2A/master
use pr body text to mark PR region
- Loading branch information
Showing
4 changed files
with
30 additions
and
17 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,8 +48,22 @@ jobs: | |
echo UPDATE_NEEDED is "${UPDATE_NEEDED}" | ||
echo API version is "${API_VERSION}" | ||
continue-on-error: true | ||
- name: Create Pull Request | ||
- name: Create PR body text | ||
if: env.UPDATE_NEEDED == 'true' | ||
run: | | ||
touch pr_body.txt | ||
echo "## Automated JSON API Update" >> pr_body.txt | ||
echo "Hello! This is an automatic pull request to merge the new JSON API version **${API_VERSION}** into the master branch." >> pr_body.txt | ||
echo "### Details" >> pr_body.txt | ||
echo "- **Workflow Trigger**: This update is triggered by the **Update JSON API (recurring job)** workflow." >> pr_body.txt | ||
echo "- **Reason for Update**: A new JSON schema version was generated that differs from the existing one in the repository." >> pr_body.txt | ||
echo "### Notes" >> pr_body.txt | ||
echo "- If you notice any issues or have questions regarding this update, please contact @alchem0x2a or other maintainers of the repository." >> pr_body.txt | ||
echo "Thank you for keeping the SPARC-X-API project up-to-date! 🚀" >> pr_body.txt | ||
cat pr_body.txt | ||
- name: Create Pull Request | ||
# Do not create PR from another PR | ||
if: (env.UPDATE_NEEDED == 'true') && (github.event_name != 'pull_request') | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Github Action Bot" | ||
|
@@ -61,18 +75,10 @@ jobs: | |
git add sparc/sparc_json_api/parameters.json | ||
git commit -m "Add new json api version ${API_VERSION}" | ||
git push --force --set-upstream origin ${BRANCH_NAME} | ||
body_msg="" | ||
body_msg="${body_msg}## Automated JSON API Update\n" | ||
body_msg="${body_msg}Hello! This is an automatic pull request to merge the new JSON API version **${API_VERSION}** into the master branch.\n\n" | ||
body_msg="${body_msg}### Details:\n" | ||
body_msg="${body_msg}- **Workflow Trigger**: This update is triggered by the **Update JSON API (recurring job)** workflow.\n" | ||
body_msg="${body_msg}- **Reason for Update**: A new JSON schema version was generated that differs from the existing one in the repository.\n\n" | ||
body_msg="${body_msg}### Notes:\n" | ||
body_msg="${body_msg}- If you notice any issues or have questions regarding this update, please contact @alchem0x2a or other maintainers of the repository.\n\n" | ||
body_msg="${body_msg}Thank you for keeping the SPARC-X-API project up-to-date! 🚀\n" | ||
gh pr create --base master \ | ||
--title "[PR Bot] New JSON API version ${API_VERSION}" \ | ||
--body "${body_msg}" \ | ||
--body-file pr_body.txt \ | ||
-R ${{ github.repository_owner }}/SPARC-X-API | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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