-
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
Add a workflow to synchronize refs from git/git to gitgitgadget/git #1
Conversation
A couple of other thoughts.
|
I was considering this, but it looks as if this would rather complicate the code, and it is already more complicated than I had wished.
Valid concern! However, this is something we need to tackle on the GitHub App side, which is expected to trigger this workflow. |
@webstech thank you for your review! I pushed an updated version (addressing all suggestions except the reusable workflows one). |
# fetch some commits | ||
git fetch --depth 10000 source ${{ steps.check.outputs.source-sha }} | ||
rm -f .git/shallow | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't the rest of the code be included in this if? ie, no fetch, so no push?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dscho Did you miss this or was I mistaken?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry, I missed your comment.
No, the rest of the code still needs to run: the workflow could be triggered by a deletion, in which case source-sha
would be empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the workflow could be triggered by a deletion, in which case
source-sha
would be empty.
TIL on a push, an empty <src>
in the refspec will delete the <dst>
ref. Good to know.
Wouldn't it be the same as refs (with more inputs specified)?
Still thinking about how to have test runs against my own mock repos. It can wait if you want since the PAT support would also be needed. |
I guess we could make those workflow inputs (with the current values in the |
The idea is, of course, to act on the `push` webhook that dutifully pings GitGitGadget's GitHub App every time a ref is pushed to `git/git`, and to let the App trigger this shiny new workflow to do the honors of keeping gitgitgadget/git up to date. Signed-off-by: Johannes Schindelin <[email protected]>
@webstech I've now done that. |
We added the `sync-ref` GitHub workflow in gitgitgadget/gitgitgadget-workflows#1 specifically to let it be triggered by `push` webhook events delivered to GitGitGadget's GitHub App. And this is the commit that teaches the GitHub App that trick. Signed-off-by: Johannes Schindelin <[email protected]>
We added the `sync-ref` GitHub workflow in gitgitgadget/gitgitgadget-workflows#1 specifically to let it be triggered by `push` webhook events delivered to GitGitGadget's GitHub App. And this is the commit that teaches the GitHub App that trick. Signed-off-by: Johannes Schindelin <[email protected]>
The idea is, of course, to act on the
push
webhook that dutifully pings GitGitGadget's GitHub App every time a ref is pushed togit/git
, and to let the App trigger this shiny new workflow to do the honors of keeping gitgitgadget/git up to date.That change to the GitHub App will have to be implemented, still, but first this here PR needs to be reviewed and merged because GitHub workflows can only be triggered by
workflow_dispatch
events if their definitions are on the main branch.