-
Notifications
You must be signed in to change notification settings - Fork 490
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
base: dev
Are you sure you want to change the base?
Conversation
73b6927
to
fb53e71
Compare
on: | ||
# Run monthly on the 1st day of each month at midnight UTC | ||
schedule: | ||
- cron: '0 0 1 * *' |
There was a problem hiding this comment.
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.
$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" |
There was a problem hiding this comment.
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.
- 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])" | ||
} | ||
} |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
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.