Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow forch push without lease #87

Open
3 of 5 tasks
lawvs opened this issue Jun 19, 2023 · 0 comments
Open
3 of 5 tasks

Allow forch push without lease #87

lawvs opened this issue Jun 19, 2023 · 0 comments
Assignees
Labels
feature Adding a new feature

Comments

@lawvs
Copy link

lawvs commented Jun 19, 2023

📝 Brief description

By default, the force parameter is not a true --force but --force-with-lease. It will cause a push to fail when attempting to overwrite a remote branch.

This situation is likely to occur when used together with action-pull-request.

[INFO] Force pushing changes
To https://github.com/toeverything/xxx
 ! [rejected]        bot/sync -> bot/sync (stale info)
error: failed to push some refs to 'https://github.com/toeverything/xxx'
      - uses: devops-infra/action-commit-push@master
        with:
          github_token: "${{ secrets.GITHUB_TOKEN }}"
          commit_prefix: "[AUTO]"
          commit_message: "Sync"
          force: true
          target_branch: bot/sync

      - uses: devops-infra/[email protected]
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          title: "[AUTO] Update"
          target_branch: main

--force-with-lease alone, without specifying the details, will protect all remote refs that are going to be updated by requiring their current value to be the same as the remote-tracking branch we have for them.
https://git-scm.com/docs/git-push#:~:text=is%20still%20valid.-,%2D%2Dforce%2Dwith%2Dlease,-alone%2C%20without%20specifying

⚠️ Checklist

  • Provided a clear and concise description of what the issue is.
  • Given a clear and concise description of what is expected.
  • Proposed a clear and concise description of any alternative solutions or other features.
  • Added any other context or screenshots about the feature request.
  • Associated pull request has been already created and link was provided.

Check CONTRIBUTING.md and CODE_OF_CONDUCT.md for more information

@ChristophShyper ChristophShyper self-assigned this Jun 19, 2023
@ChristophShyper ChristophShyper added the feature Adding a new feature label Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Adding a new feature
Development

No branches or pull requests

2 participants