-
Notifications
You must be signed in to change notification settings - Fork 129
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 #297 from roundcube/update.sh-fix-for-no-changes
- Loading branch information
Showing
1 changed file
with
8 additions
and
7 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 |
---|---|---|
|
@@ -24,16 +24,17 @@ jobs: | |
- name: Run update.sh script | ||
run: ./update.sh | ||
- name: Commit files | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
BRANCH="changes-from-update.sh-$(date +'%Y-%m-%d')" | ||
git show-ref --quiet "$BRANCH" && { "ERROR: Branch $BRANCH already exists"; exit 1; } | ||
# Exit early if no changes are present. | ||
test $(git status --porcelain | wc -l) -gt 0 || { echo "No changes to commit, happily cancelling this script."; exit 0; } | ||
# Use a distinct branch-name (nano-seconds should be good enough). | ||
BRANCH="changes-from-update.sh-$(date -I ns)" | ||
git switch -C "$BRANCH" | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Workflow" | ||
git add -A | ||
git commit -m "Update roundcube version (via update.sh)" || echo "Nothing to update" | ||
git commit -m "Update roundcube version (via update.sh)" | ||
git push --set-upstream origin "$BRANCH" | ||
- name: Create Pull Request | ||
run: gh pr create -B master -H changes-from-update.sh --title 'Changes from update.sh' --body "These are the changes of the automated run of ./update.sh" --assignee pabzm | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
gh pr create -B master -H changes-from-update.sh --title 'Changes from update.sh' --body "These are the changes of the automated run of ./update.sh" --assignee pabzm |