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
Make commit and push into separated optional steps #240
Comments
Thanks for the suggestion! The only issue I currently see is in educating users how this feature should be used.
This won't work, as the state of each job is independent. Job 1 doesn't know about the state of the git repo in Job 2. But users who would build such workflows/jobs probably already know, that they have to checkout their repo in each job step. |
Oh, I just noticed that maybe I can achieve this by simply passing |
|
It seems like it does not. The action in case there was nothing to commit shows this output:
But if
So properly supporting this might require two new options, one to skip pushing, and one to always attempt pushing... (or just always attempt pushing even if no commit creation was expected?) |
You're right. In my own repo I didn't rely on this action for the final push and simply call a |
@stefanzweifel btw does push have to be protected by the status check? Pushing with no change seems to be harmless. If we put this step outside the |
When I developed the Action, this made the most sense (and it still does to me). Do you have in mind, that the Action the would always execute If we do that, I think we would have to test different scenarios. On top of my head the following come to mind:
Maybe it would make sense to split the logic of the Action in to 2 buckets: "Creating Commit" / "Pushing Commit".
I think something got lost in translation here. Would you use the Action like this? # This step would always try to push something.
- uses: stefanzweifel/git-auto-commit-action@v4
- name: Change Files
run: # Do something to make repo dirty
# This step would create a commit and push it.
- uses: stefanzweifel/git-auto-commit-action@v4 Would be so great if you could share workflow examples of how you intend to use the Action. |
@stefanzweifel
In the final step we are facing a state where there is only committed but un-pushed changes, which would not be picked up by the action. |
@ZeroRin Thanks for sharing the workflow. This makes understanding your problem much easier and I can see that this is a legitimate usage of the Action. My plan is to work on the Action more in December/January. Will try different things and hopefully release a new version with this feature soonish. |
Is your feature request related to a problem? Please describe.
I have a repository with two workflows:
As soon as workflow 1 commits data from first source, it triggers workflow 2. As the two workflows now run in parallel and both may have new commits, further commit from one workflow will be rejected.
Describe the solution you'd like
Add an option to disable the commit or push step of this action. As in workflow, the push event may be intentionally used to trigger other workflows, it makes sense to provide more controllable push to me.
In my case, I want workflow 1 to create multiple commits without push, and a single push at the end of the workflow.
The text was updated successfully, but these errors were encountered: