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

Can't push branch and create tag at the same time #145

Closed
evantahler opened this issue Feb 26, 2021 · 10 comments
Closed

Can't push branch and create tag at the same time #145

evantahler opened this issue Feb 26, 2021 · 10 comments
Labels
bug Something isn't working

Comments

@evantahler
Copy link

evantahler commented Feb 26, 2021

Version of the Action
v4 (@v4)

Describe the bug

Reading the docs, I would expect the following to both push any changes back to the branch AND tag that commit with env.CORE_VERSION. However, what is happening is that the tag is created but the branch is not updated.

Action will create and push a new tag to the remote repository and the defined branch

      - uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: Updating Packages
          commit_user_name: Grouparoo Bot
          commit_user_email: hello@grouparoo.com
          commit_author: Grouparoo Bot <hello@grouparoo.com>
          branch: ${{ github.head_ref }}
          tagging_message: v${{ env.CORE_VERSION }}

Action: https://github.com/grouparoo/app-example/blob/master/.github/workflows/update.yml
Run: https://github.com/grouparoo/app-example/runs/1983284335?check_suite_focus=true

Specifcally:

Started: bash /home/runner/work/_actions/stefanzweifel/git-auto-commit-action/v4/entrypoint.sh
INPUT_REPOSITORY value: .
INPUT_BRANCH value: 
From https://github.com/grouparoo/app-example
 * [new branch]      helm       -> origin/helm
M	package-lock.json
M	package.json
Your branch is up to date with 'origin/master'.
INPUT_FILE_PATTERN: .
INPUT_COMMIT_OPTIONS: 
INPUT_COMMIT_USER_NAME: Grouparoo Bot
INPUT_COMMIT_USER_EMAIL: hello@grouparoo.com
INPUT_COMMIT_MESSAGE: Updating Packages
INPUT_COMMIT_AUTHOR: Grouparoo Bot <hello@grouparoo.com>
[master 1ede8b3] Updating Packages
 2 files changed, 738 insertions(+), 893 deletions(-)
INPUT_TAGGING_MESSAGE: v0.2.3
INPUT_PUSH_OPTIONS: 
To https://github.com/grouparoo/app-example
 * [new tag]         v0.2.3 -> v0.2.3

Expected behavior
I would expect both the branch to be pushed with the latest code & the tag to be created.

@stefanzweifel
Copy link
Owner

Thanks for reporting!

As you said, the tag is created: grouparoo/app-examples@1ede8b3

I wonder if this is related to this message GitHub displays :

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files.

Maybe it's related that the workflow was triggered by workflow_dispatch 🤔
https://github.com/grouparoo/app-example/actions/runs/600989846

I will try to come up with a failing test for our test suite to ensure that we can reproduce this.

@stefanzweifel stefanzweifel added the bug Something isn't working label Feb 26, 2021
@evantahler
Copy link
Author

Thanks!

Here's what I'm doing in the interum grouparoo/app-examples#124

@stefanzweifel
Copy link
Owner

@evantahler Can confirm that the pushed commits are not correct. Will push a PR with tests and a solution shortly.

Would then be great if you could test those changes in your project, to make sure it really works as expected.

@stefanzweifel
Copy link
Owner

stefanzweifel commented Feb 26, 2021

@evantahler I've opened a PR with a fix in #146

You can use it by updating your workflow like this:

-       - uses: stefanzweifel/git-auto-commit-action@v4
+       - uses: stefanzweifel/git-auto-commit-action@fixes/145
         with:
           commit_message: Updating Packages
           commit_user_name: Grouparoo Bot
           commit_user_email: hello@grouparoo.com
           commit_author: Grouparoo Bot <hello@grouparoo.com>
           branch: ${{ github.head_ref }}
           tagging_message: v${{ env.CORE_VERSION }}

I will do some additional tests in my own projects. If everything goes well, I will tag a new version next week.

@evantahler
Copy link
Author

Thanks for checking this out so quickly! It works!

I gave it a try:

Produced this commit grouparoo/app-examples@8f4c57d and the tag https://github.com/grouparoo/app-example/releases/tag/v0.2.3

@stefanzweifel
Copy link
Owner

v4.9.2 has been released which includes the mentioned fix.

I will close this issue now.
Feel free to reopen or open a new issue if you have a problem.

Thanks again for reporting!

@evantahler
Copy link
Author

Thank you!

@evantahler
Copy link
Author

evantahler commented Mar 4, 2021

Huh... https://github.com/grouparoo/app-example/actions/runs/622211253

Unable to resolve action stefanzweifel/git-auto-commit-action@4.9.2, unable to find version 4.9.2

@stefanzweifel
Copy link
Owner

@evantahler Can you try it with stefanzweifel/git-auto-commit-action@v4.9.2 or just v4?

@evantahler
Copy link
Author

OH! I forgot the v. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants