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

ci: go mod auto-update runs on push to curr #4666

Closed
wants to merge 1 commit into from

Conversation

p0mvn
Copy link
Member

@p0mvn p0mvn commented Mar 19, 2023

Closes: #4660

What is the purpose of the change

Currently, go.mod auto-update runs on push to every branch.

Instead, it should be running on push to the current branch.

Testing and Verifying

This change is a trivial rework / code cleanup without any test coverage.

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes? no
  • Is a relevant changelog entry added to the Unreleased section in CHANGELOG.md? no
  • How is the feature or change documented? not applicable

@p0mvn p0mvn requested a review from pysel March 19, 2023 05:14
@p0mvn p0mvn marked this pull request as ready for review March 19, 2023 05:14
@github-actions github-actions bot added the T:CI label Mar 19, 2023
@@ -8,6 +8,8 @@
name: Go Mod Auto Version Update
on:
push:
branches:
- ${{ github.ref }}
Copy link
Member

@pysel pysel Mar 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think with this syntax the workflow will run only when the push to github.ref is made. However, this variable is only accessible when the workflow is running, so, I suspect, that when GH Actions check if the condition for this workflow is met, it will see github.ref as a blank string, because as I said, this variable is only accessible when workflow is running. I will check if that is indeed like that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if I am right, I will check out other ways of how this can be done properly

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this workflow will never run with these changes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is that a problem?

This should be checked once a push is made to the current branch. A push triggers the workflow run where github.ref is accessible

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand now. ChatGPT was confusing me here:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix: go mod auto-update to commit to custom branch when dependency module is updated
2 participants