Skip to content

feat: go mod auto version update#1848

Closed
maxday wants to merge 0 commit into
open-telemetry:mainfrom
maxday:main
Closed

feat: go mod auto version update#1848
maxday wants to merge 0 commit into
open-telemetry:mainfrom
maxday:main

Conversation

@maxday

@maxday maxday commented Jun 4, 2025

Copy link
Copy Markdown
Member

This is a follow-up PR on this: #1839 to complete this: #1838

I've tried it on my fork and the PR with a bump is indeed created see the example here: maxday#7

Quick notes:

  • Since the PR is created from a worflow step, it does NOT auto trigger the collector check to run (This is a documented mechanism to increase security + to prevent loops)
  • I've added a step to run the check but there is no easy way to report the status on the PR. I think I can make it work with custom checks but I think it's good enough like this). When a new PR like this is created, we would need to manually check the status of the triggered action, IMO, it's still a huge benefit to have this auto-bump which is already detecting that we're behind one minor version 😅.

Let me know!
Max

@maxday
maxday requested a review from a team as a code owner June 4, 2025 06:57
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: 030/gomod-go-version-updater-action@7de28fa4093a877ba8924f7901e6c7b6e5dd3954 # v0.3.3 No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this being used anywhere else within otel?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@tylerbenson no I could not find other usage. Maybe we can pioneer this and influence other go repos if this is working well for us?
if you look at the code, it's a very simple action: https://github.com/030/gomod-go-version-updater-action/blob/main/main.py

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@trask @carlosalberto @jaronoff97 @codeboten WDYT? Does this need further review or good to go?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

from a security perspective, I personally avoid github actions that are not widely used, since it's one more attack vector you have to worry about

that said, I don't think we have any official guidance for OpenTelemetry repositories, and I suspect that we would first focus on limiting the github token permissions, since that's typically the easier win:

An action can access the GITHUB_TOKEN through the github.token context even if the workflow does not explicitly pass the GITHUB_TOKEN to the action. As a good security practice, you should always make sure that actions only have the minimum access they require by limiting the permissions granted to the GITHUB_TOKEN. For more information, see Permissions for the GITHUB_TOKEN.

(https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow)

In this particular case though, have you checked if Renovate will automatically update this for you? The majority of OpenTelemetry repos are on Renovate now, and I believe the Go repos were early Renovate adopters.

cc @open-telemetry/sig-security-approvers @open-telemetry/go-approvers

@tylerbenson tylerbenson added the github_actions Pull requests that update GitHub Actions code label Jun 6, 2025
@maxday maxday closed this Jun 10, 2025
@maxday

maxday commented Jun 11, 2025

Copy link
Copy Markdown
Member Author

oops sorry I removed the branch 😶‍🌫️ , will reopen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants