-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: now a PR is used to merge pizza CLI changes (#3)
* feat: now a PR is used to merge pizza CLI changes * docs: updated docs to reflect PRs being used to merge changes now * now the action uses the OpenSauced bot account * docs: typo fix * updated PR script with PR feedback * docs: fixed a typo in a filename
- Loading branch information
1 parent
84329a9
commit d2a1dcf
Showing
4 changed files
with
53 additions
and
11 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
PR_TITLE="chore (automated): OpenSauced updates" | ||
BRANCH_NAME="chore_automated_open-sauced-updates_$(date +%s)" | ||
|
||
git checkout -b "$BRANCH_NAME" | ||
|
||
# There are potentially multiple files to add from the pizza CLI output | ||
git add . | ||
|
||
# Check if there are any changes to commit | ||
if [[ -n "$(git status --porcelain)" ]]; then | ||
echo "Creating PR \"$PR_TITLE\" for branch "$BRANCH_NAME"" | ||
git commit -m "$PR_TITLE" | ||
git push origin "$BRANCH_NAME" | ||
|
||
# Attempt to create the PR (dry run) | ||
if gh pr create --title "$PR_TITLE" --body "This is an automated PR generated by the OpenSauced pizza-action." --dry-run; then | ||
# If dry run is successful, create the actual PR | ||
PR_URL=$(gh pr create --title "$PR_TITLE" --body "This is an automated PR generated by the OpenSauced pizza-action.") | ||
echo "PR created successfully: $PR_URL" | ||
else | ||
echo "Failed to create PR. There might be an issue with branch permissions or other repository settings." | ||
fi | ||
else | ||
# Shouldn't end up here, but log that there was nothing to sync | ||
echo "Looks like there was nothing to update." | ||
fi |