Skip to content

Commit da91dcf

Browse files
salmanmkcGarrettBeatty
authored andcommitted
Upgrade GitHub Actions for Node 24 compatibility
Signed-off-by: Salman Muin Kayser Chishti <13schishti@gmail.com>
1 parent 4eef1e8 commit da91dcf

6 files changed

Lines changed: 44 additions & 104 deletions

File tree

.github/workflows/auto-update-Dockerfiles.yml

Lines changed: 28 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ on:
1010
- cron: '0 0 * * *'
1111
# Allows to run this workflow manually from the Actions tab for testing
1212
workflow_dispatch:
13+
14+
1315

1416
jobs:
1517
auto-update:
@@ -21,11 +23,10 @@ jobs:
2123
NET_9_ARM64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile"
2224
NET_10_AMD64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile"
2325
NET_10_ARM64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile"
24-
NET_11_AMD64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net11/amd64/Dockerfile"
25-
NET_11_ARM64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net11/arm64/Dockerfile"
2626

2727
steps:
28-
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v4.2.2
28+
# Checks-out the repository under $GITHUB_WORKSPACE
29+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2930
with:
3031
ref: 'dev'
3132

@@ -113,82 +114,39 @@ jobs:
113114
Write-Host "Skipping .NET 10 ARM64 update - No version detected"
114115
}
115116
116-
# Update .NET 11 AMD64 Dockerfile
117-
- name: Update .NET 11 AMD64
118-
id: update-net11-amd64
119-
shell: pwsh
120-
env:
121-
DOCKERFILE_PATH: ${{ env.NET_11_AMD64_Dockerfile }}
122-
run: |
123-
$version = & "./LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1" -MajorVersion "11"
124-
if (-not [string]::IsNullOrEmpty($version)) {
125-
& "./LambdaRuntimeDockerfiles/update-dockerfile.ps1" -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version
126-
} else {
127-
Write-Host "Skipping .NET 11 AMD64 update - No version detected"
128-
}
129-
130-
# Update .NET 11 ARM64 Dockerfile
131-
- name: Update .NET 11 ARM64
132-
id: update-net11-arm64
133-
shell: pwsh
134-
env:
135-
DOCKERFILE_PATH: ${{ env.NET_11_ARM64_Dockerfile }}
136-
run: |
137-
$version = & "./LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1" -MajorVersion "11"
138-
if (-not [string]::IsNullOrEmpty($version)) {
139-
& "./LambdaRuntimeDockerfiles/update-dockerfile.ps1" -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version
140-
} else {
141-
Write-Host "Skipping .NET 11 ARM64 update - No version detected"
142-
}
143-
144117
# Commit changes and create a branch
145118
- name: Commit and Push
146119
id: commit-push
147120
shell: pwsh
148121
run: |
149-
git config --global user.email "github-aws-sdk-dotnet-automation@amazon.com"
150-
git config --global user.name "aws-sdk-dotnet-automation"
151-
152-
$remoteBranch = "chore/auto-update-Dockerfiles-daily"
153-
154-
# Try to fetch the remote branch (it may not exist yet)
155-
git fetch origin $remoteBranch 2>$null
156-
$remoteExists = ($LASTEXITCODE -eq 0)
157-
158122
# Check if there are any changes to commit
159123
if (git status --porcelain) {
160-
124+
git config --global user.email "github-aws-sdk-dotnet-automation@amazon.com"
125+
git config --global user.name "aws-sdk-dotnet-automation"
126+
161127
# Generate timestamp for unique local branch name
162128
$timestamp = Get-Date -Format "yyyyMMddHHmmss"
163129
$localBranch = "chore/auto-update-Dockerfiles-daily-$timestamp"
164-
130+
$remoteBranch = "chore/auto-update-Dockerfiles-daily"
131+
165132
# Always create a new unique local branch
166133
git checkout -b $localBranch
167-
134+
168135
git add "**/*Dockerfile"
169136
git commit -m "chore: Daily ASP.NET Core version update in Dockerfiles"
170-
171-
# If remote branch exists and there is no diff vs remote branch, skip pushing and PR creation
172-
if ($remoteExists) {
173-
git diff --quiet "origin/$remoteBranch...HEAD"
174-
if ($LASTEXITCODE -eq 0) {
175-
echo "No diff vs origin/$remoteBranch. Skipping push/PR creation."
176-
Add-Content -Path $env:GITHUB_OUTPUT -Value "CHANGES_MADE=false"
177-
exit 0
178-
}
179-
}
180-
181-
# Only now delete + push (because we know it's different)
137+
138+
# Always delete the remote branch before pushing to avoid stale branch errors
182139
git push origin --delete $remoteBranch 2>$null
140+
141+
# Push local branch to remote branch (force push to consistent remote branch name)
183142
git push --force origin "${localBranch}:${remoteBranch}"
184-
143+
185144
# Write the remote branch name to GITHUB_OUTPUT for use in the PR step
186145
Add-Content -Path $env:GITHUB_OUTPUT -Value "BRANCH=$remoteBranch"
187146
Add-Content -Path $env:GITHUB_OUTPUT -Value "CHANGES_MADE=true"
188147
echo "Changes committed to local branch $localBranch and pushed to remote branch $remoteBranch"
189148
} else {
190149
echo "No changes detected in Dockerfiles, skipping PR creation"
191-
Add-Content -Path $env:GITHUB_OUTPUT -Value "CHANGES_MADE=false"
192150
}
193151
194152
# Create a Pull Request
@@ -201,27 +159,25 @@ jobs:
201159
destination_branch: "dev"
202160
pr_title: 'chore: Daily ASP.NET Core version update in Dockerfiles'
203161
pr_body: "This PR automatically updates the Dockerfiles to use the latest ASP.NET Core version.
204-
162+
205163
Verify that the Dockerfiles have correct versions and matching SHA512 checksums for ASP.NET Core runtime.
206-
164+
207165
All .NET versions: https://dotnet.microsoft.com/en-us/download/dotnet
208-
166+
209167
*Description of changes:*
210168
\n${{ format
211-
(
212-
'{0}\n{1}\n{2}\n{3}\n{4}\n{5}\n{6}\n{7}',
213-
join(steps.update-net8-amd64.outputs.MESSAGE, '\n'),
214-
join(steps.update-net8-arm64.outputs.MESSAGE, '\n'),
215-
join(steps.update-net9-amd64.outputs.MESSAGE, '\n'),
216-
join(steps.update-net9-arm64.outputs.MESSAGE, '\n'),
217-
join(steps.update-net10-amd64.outputs.MESSAGE, '\n'),
218-
join(steps.update-net10-arm64.outputs.MESSAGE, '\n'),
219-
join(steps.update-net11-amd64.outputs.MESSAGE, '\n'),
220-
join(steps.update-net11-arm64.outputs.MESSAGE, '\n')
221-
)
169+
(
170+
'{0}\n{1}\n{2}\n{3}\n{4}\n{5}',
171+
join(steps.update-net8-amd64.outputs.MESSAGE, '\n'),
172+
join(steps.update-net8-arm64.outputs.MESSAGE, '\n'),
173+
join(steps.update-net9-amd64.outputs.MESSAGE, '\n'),
174+
join(steps.update-net9-arm64.outputs.MESSAGE, '\n'),
175+
join(steps.update-net10-amd64.outputs.MESSAGE, '\n'),
176+
join(steps.update-net10-arm64.outputs.MESSAGE, '\n')
177+
)
222178
}}"
223179
github_token: ${{ secrets.GITHUB_TOKEN }}
224-
180+
225181
# Add "Release Not Needed" label to the PR
226182
- name: Add Release Not Needed label
227183
if: ${{ steps.pull-request.outputs.pr_number }}

.github/workflows/change-file-in-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
steps:
1414
- name: Checkout PR code
15-
uses: actions/checkout@v4
15+
uses: actions/checkout@v6
1616

1717
- name: Get List of Changed Files
1818
id: changed-files

.github/workflows/create-release-pr.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ on:
1313

1414
permissions:
1515
id-token: write
16-
repository-projects: read
1716

1817
jobs:
1918
release-pr:
@@ -26,38 +25,33 @@ jobs:
2625
steps:
2726
# Assume an AWS Role that provides access to the Access Token
2827
- name: Configure AWS Credentials
29-
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 #v6.0.0
28+
uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 #v5.1.1
3029
with:
3130
role-to-assume: ${{ secrets.RELEASE_WORKFLOW_ACCESS_TOKEN_ROLE_ARN }}
3231
aws-region: us-west-2
3332
# Retrieve the Access Token from Secrets Manager
3433
- name: Retrieve secret from AWS Secrets Manager
35-
uses: aws-actions/aws-secretsmanager-get-secrets@3a411b6ec5cace3d626412dd917e7bfeac242cfa #v3.0.0
34+
uses: aws-actions/aws-secretsmanager-get-secrets@a9a7eb4e2f2871d30dc5b892576fde60a2ecc802 #v2.0.10
3635
with:
3736
secret-ids: |
3837
AWS_SECRET, ${{ secrets.RELEASE_WORKFLOW_ACCESS_TOKEN_NAME }}
3938
parse-json-secrets: true
4039
# Checkout a full clone of the repo
4140
- name: Checkout
42-
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 #v4.2.2
41+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4342
with:
4443
fetch-depth: "0"
4544
token: ${{ env.AWS_SECRET_TOKEN }}
4645
# Install .NET9 which is needed for AutoVer
4746
- name: Setup .NET 9.0
48-
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 #v5.2.0
47+
uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0
4948
with:
5049
dotnet-version: 9.0.x
5150
# Install .NET10 which is needed for building the solution
5251
- name: Setup .NET 10.0
53-
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 #v5.2.0
52+
uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0
5453
with:
5554
dotnet-version: 10.0.x
56-
# Install .NET11 which is needed for building the solution
57-
- name: Setup .NET 11.0
58-
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 #v5.2.0
59-
with:
60-
dotnet-version: 11.0.x
6155
# Install AutoVer to automate versioning and changelog creation
6256
- name: Install AutoVer
6357
run: dotnet tool install --global AutoVer --version 0.0.25

.github/workflows/semgrep-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
if: (github.actor != 'dependabot[bot]')
2626
steps:
2727
# Fetch project source
28-
- uses: actions/checkout@v4
28+
- uses: actions/checkout@v6
2929

3030
- run: semgrep ci --sarif > semgrep.sarif
3131
env:

.github/workflows/sync-master-dev.yml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,39 +26,34 @@ jobs:
2626
steps:
2727
# Assume an AWS Role that provides access to the Access Token
2828
- name: Configure AWS Credentials
29-
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 #v6.0.0
29+
uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 #v5.1.1
3030
with:
3131
role-to-assume: ${{ secrets.RELEASE_WORKFLOW_ACCESS_TOKEN_ROLE_ARN }}
3232
aws-region: us-west-2
3333
# Retrieve the Access Token from Secrets Manager
3434
- name: Retrieve secret from AWS Secrets Manager
35-
uses: aws-actions/aws-secretsmanager-get-secrets@3a411b6ec5cace3d626412dd917e7bfeac242cfa #v3.0.0
35+
uses: aws-actions/aws-secretsmanager-get-secrets@a9a7eb4e2f2871d30dc5b892576fde60a2ecc802 #v2.0.10
3636
with:
3737
secret-ids: |
3838
AWS_SECRET, ${{ secrets.RELEASE_WORKFLOW_ACCESS_TOKEN_NAME }}
3939
parse-json-secrets: true
4040
# Checkout a full clone of the repo
4141
- name: Checkout code
42-
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 #v4.2.2
42+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4343
with:
4444
ref: dev
4545
fetch-depth: 0
4646
token: ${{ env.AWS_SECRET_TOKEN }}
4747
# Install .NET9 which is needed for AutoVer
4848
- name: Setup .NET 9.0
49-
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 #v5.2.0
49+
uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0
5050
with:
5151
dotnet-version: 9.0.x
5252
# Install .NET10 which is needed for building the solution
5353
- name: Setup .NET 10.0
54-
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 #v5.2.0
54+
uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0
5555
with:
5656
dotnet-version: 10.0.x
57-
# Install .NET11 which is needed for building the solution
58-
- name: Setup .NET 11.0
59-
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 #v5.2.0
60-
with:
61-
dotnet-version: 11.0.x
6257
# Install AutoVer which is needed to retrieve information about the current release.
6358
- name: Install AutoVer
6459
run: dotnet tool install --global AutoVer --version 0.0.25
@@ -121,25 +116,20 @@ jobs:
121116
steps:
122117
# Checkout a full clone of the repo
123118
- name: Checkout code
124-
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 #v4.2.2
119+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
125120
with:
126121
ref: releases/next-release
127122
fetch-depth: 0
128123
# Install .NET9 which is needed for AutoVer
129124
- name: Setup .NET 9.0
130-
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 #v5.2.0
125+
uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0
131126
with:
132127
dotnet-version: 9.0.x
133128
# Install .NET10 which is needed for building the solution
134129
- name: Setup .NET 10.0
135-
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 #v5.2.0
130+
uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0
136131
with:
137132
dotnet-version: 10.0.x
138-
# Install .NET11 which is needed for building the solution
139-
- name: Setup .NET 11.0
140-
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 #v5.2.0
141-
with:
142-
dotnet-version: 11.0.x
143133
# Install AutoVer which is needed to retrieve information about the current release.
144134
- name: Install AutoVer
145135
run: dotnet tool install --global AutoVer --version 0.0.25

.github/workflows/update-Dockerfiles.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
# Steps represent a sequence of tasks that will be executed as part of the job
8282
steps:
8383
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
84-
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 #v4.2.2
84+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8585
with:
8686
ref: 'dev'
8787

0 commit comments

Comments
 (0)