Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 27, 2026

Implements automated monthly checks for new Go releases with PR creation for go.mod updates.

Implementation

  • Schedule: Monthly cron on 1st at 9:00 UTC, manual trigger via workflow_dispatch
  • Version detection: Uses actions/setup-go@v5 with go-version: stable to fetch latest release
  • Comparison logic: Custom semantic version normalization supporting both major.minor and major.minor.patch formats
  • Update mechanism: Modifies go.mod via sed, runs go mod tidy, creates PR with peter-evans/create-pull-request@v7

Version Normalization

Handles version format variations and validates numeric components:

normalize_version() {
  IFS='.' read -ra PARTS <<< "$1"
  local major="${PARTS[0]}" minor="${PARTS[1]}" patch="${PARTS[2]:-0}"
  
  # Validation: format and numeric checks
  [[ -z "$major" || -z "$minor" ]] && return 1
  [[ ! "$major" =~ ^[0-9]+$ ]] && return 1
  
  printf "%05d%05d%05d" "$major" "$minor" "$patch"
}

Comparison uses normalized strings to handle 1.211.21.0 correctly while detecting actual version changes like 1.21.51.22.0.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 5 commits January 27, 2026 00:46
Co-authored-by: madhanrm <20309044+madhanrm@users.noreply.github.com>
Co-authored-by: madhanrm <20309044+madhanrm@users.noreply.github.com>
Co-authored-by: madhanrm <20309044+madhanrm@users.noreply.github.com>
Co-authored-by: madhanrm <20309044+madhanrm@users.noreply.github.com>
Co-authored-by: madhanrm <20309044+madhanrm@users.noreply.github.com>
Copilot AI changed the title [WIP] Create workflow to update Golang version monthly Add monthly automated Go version update workflow Jan 27, 2026
Copilot AI requested a review from madhanrm January 27, 2026 00:52
@madhanrm madhanrm marked this pull request as ready for review January 27, 2026 00:55
@madhanrm
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants