Skip to content

auto update lambda runtime images #2112

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

Draft
wants to merge 13 commits into
base: dev
Choose a base branch
from
Draft

Conversation

GarrettBeatty
Copy link
Contributor

@GarrettBeatty GarrettBeatty commented Jul 16, 2025

Issue #, if available:

This script will run on a monthly basis and create PR to update all the OCI images. i was getting lazy on running the github action myself. previously we had to go to microsoft's website and copy the version number and invoke the github action. this script just queries nuget to get the latest version

Description of changes:
Example PR #2114

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@GarrettBeatty GarrettBeatty changed the base branch from master to dev July 16, 2025 00:59
@GarrettBeatty GarrettBeatty added the Release Not Needed Add this label if a PR does not need to be released. label Jul 16, 2025
@GarrettBeatty GarrettBeatty marked this pull request as ready for review July 16, 2025 01:00
@GarrettBeatty GarrettBeatty requested review from philasmar and normj July 16, 2025 01:00
on:
# Run monthly on the 1st day of each month at midnight UTC
schedule:
- cron: '0 0 1 * *'
Copy link
Contributor

Choose a reason for hiding this comment

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

we should run this daily. We don't want to be a month late for the patches. Our goal is to get the updated OCIs to Lambda as quickly as possible.

Comment on lines +121 to +147
$net8Version = Get-LatestAspNetVersion -majorVersion "8"
$net9Version = Get-LatestAspNetVersion -majorVersion "9"
$net10Version = Get-LatestAspNetVersion -majorVersion "10"

# Verify we got valid versions
$allVersionsValid = $true
if (-not $net8Version) {
Write-Error "Failed to determine .NET 8 version"
$allVersionsValid = $false
}
if (-not $net9Version) {
Write-Error "Failed to determine .NET 9 version"
$allVersionsValid = $false
}
if (-not $net10Version) {
Write-Error "Failed to determine .NET 10 version"
$allVersionsValid = $false
}

if (-not $allVersionsValid) {
exit 1
}

# Output as GitHub Actions environment variables
Write-Output "NET_8_NEXT_VERSION=$net8Version"
Write-Output "NET_9_NEXT_VERSION=$net9Version"
Write-Output "NET_10_NEXT_VERSION=$net10Version"
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of you outputting the versions in this ps1, let's call it from the github workflow in each .NET version's step. That way, this ps1 stays generic and wouldn't need updating everytime we add or remove a .NET version.

Comment on lines +34 to +44
- name: Determine Latest ASP.NET Core Versions
id: get-versions
shell: pwsh
run: |
$versions = .\LambdaRuntimeDockerfiles\get-latest-aspnet-versions.ps1
foreach ($line in $versions) {
if ($line -match '(.+)=(.+)') {
echo "$($matches[1])=$($matches[2])" >> $env:GITHUB_OUTPUT
echo "Using $($matches[1])=$($matches[2])"
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

you wouldn't need this step if you update the ps1 based on my recommendation

}

# Create a Pull Request
- name: Create Pull Request
Copy link
Contributor

Choose a reason for hiding this comment

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

What would happen if we update this workflow to run daily and we don't approve and merge the created PR that same day? would this step keep creating PRs?

@GarrettBeatty GarrettBeatty marked this pull request as draft August 4, 2025 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release Not Needed Add this label if a PR does not need to be released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants