summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2024-04-16 09:09:06 +1000
committerGitHub <noreply@github.com>2024-04-16 09:09:06 +1000
commit9e5ceaa1ec1a44e7ccb561755b051656fd00732c (patch)
tree7a696f2071468eb1e0bbfeebb8f974d912b69af3
parent145fb6191c108f7e7af8180106b82f0503a7994c (diff)
parentba0c00b5d1d8dde532bc882e2cf81d70035b370f (diff)
sponsors.yml: Create PR instead of trying to push to a protected branch (#3493)
- **PR Description** Uses [this popular-ish action](https://github.com/marketplace/actions/create-pull-request) to create a PR. > How the action behaves: > > If there are changes (i.e. a diff exists with the checked-out base branch), the changes will be pushed to a new branch and a pull request created. > If there are no changes (i.e. no diff exists with the checked-out base branch), no pull request will be created and the action exits silently. > If a pull request already exists it will be updated if necessary. Local changes in the Actions workspace, or changes on the base branch, can cause an update. If no update is required the action exits silently. > If a pull request exists and new changes on the base branch make the pull request unnecessary (i.e. there is no longer a diff between the pull request branch and the base), the pull request is automatically closed. Additionally, if [delete-branch](https://github.com/marketplace/actions/create-pull-request#delete-branch) is set to true the branch will be deleted. Demo Action Run: https://github.com/SachinVin/lazygit/actions/runs/8675283475 Demo PR: https://github.com/SachinVin/lazygit/pull/2 You also might want to consider changing this action to trigger as a cron job instead on pushes to master. - **Please check if the PR fulfills these requirements** * [ ] Cheatsheets are up-to-date (run `go generate ./...`) * [ ] Code has been formatted (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting)) * [ ] Tests have been added/updated (see [here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md) for the integration test guide) * [ ] Text is internationalised (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation)) * [ ] Docs (specifically `docs/Config.md`) have been updated if necessary * [x] You've read through your own file changes for silly mistakes etc <!-- Be sure to name your PR with an imperative e.g. 'Add worktrees view' see https://github.com/jesseduffield/lazygit/releases/tag/v0.40.0 for examples -->
-rw-r--r--.github/workflows/sponsors.yml15
1 files changed, 7 insertions, 8 deletions
diff --git a/.github/workflows/sponsors.yml b/.github/workflows/sponsors.yml
index 61409225d..64918ce0d 100644
--- a/.github/workflows/sponsors.yml
+++ b/.github/workflows/sponsors.yml
@@ -18,11 +18,10 @@ jobs:
file: 'README.md'
if: ${{ github.repository == 'jesseduffield/lazygit' }}
- - name: Commit and push if changed
- run: |-
- git diff
- git config --global user.email "actions@users.noreply.github.com"
- git config --global user.name "README-bot"
- git add README.md
- git commit -m "Updated README.md" || exit 0
- git push
+ - name: Create Pull Request 🚀
+ uses: peter-evans/create-pull-request@v6
+ with:
+ commit-message: "README.md: Update Sponsors"
+ title: "README.md: Update Sponsors"
+ author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"
+ delete-branch: true