-
Notifications
You must be signed in to change notification settings - Fork 2
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
Initial review #14
Comments
Thank you for this! Great stuff to work on here.
This to me sounds like an optional feature so that the project maintainers can use their judgment. Although looking at the API docs, I can't easily find anything that'll close a PR, only merge one. So that might throw a spanner in the works this feature, and would be a point in favour for the "just branch" approach. Edit: I think I meant this this other way around, but I'm also not sure I easily see an API endpoint to delete a branch either, but surely that's possible?
This is good to know as at the minute, I'm stuck on git auth to clone the repo 😄 So this would solve the "needing the fork as a remote" problem. I know some actions require checkout of the repo before hand, so if we could do that and somehow pass the checkout to the Docker container, that'd be helpful. And I think the built-in GITHUB_TOKEN would have enough permissions to push. Otherwise, I think we'd need to specifically create a PAT and store it as a repository secret, which feels like it circumvents the whole point of this action 😄 |
Weirdly it seems you have to use the git API to delete branches. So maybe if you have push access already, deleting via |
On reflection I'm thinking if we do implement this, it wouldn't be in this repo built into this action. I think it's a whole other action that has probably already been implemented somewhere else. For example in mybinder.org-deploy, we could have another job that looks something like the below. jobs:
...
delete-test-branch:
# Only runs on pushes to test-this-pr/** branches
if: (github.event_name == 'push') && (contains(github.ref, 'test-this-pr'))
# Requires the deploy to staging job to succeed before this job runs
needs: staging-deploy
runs-on: ubuntu-latest
steps:
- run: |
# Some code to delete the branch Or there are some options that, e.g., sweep and delete merged and stale branches https://github.com/marketplace/actions/git-sweep-merged-and-stale |
This is great!
Some notes from looking at the action:
test-this-pr/$NUMBER
. If a PR is force-updated and then the test comment is issued again, I think this push will fail unless it's done with--force
git fetch origin pull/$NUMBER/merge:test-this-pr/$NUMBER
will fetch the existing merge ref and create the local branchtest-this-pr/$NUMBER
.I still don't know if it will work best to 'just' test the branch, or open local-branch PRs. WDYT so far after trying it out?
My initial thoughts:
The text was updated successfully, but these errors were encountered: