mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-25 12:24:47 +02:00
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 -->
This commit is contained in:
commit
9e5ceaa1ec
15
.github/workflows/sponsors.yml
vendored
15
.github/workflows/sponsors.yml
vendored
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user