Skip to content

Commit 6a20908

Browse files
authored
Upgrade to .NET 10 and update dependencies (#179)
* Upgrade to .NET 10. Pin action versions * Update dependencies and configuration for .NET 10 compatibility * Lint * Fix linting issues --------- Co-authored-by: ondfisk <[email protected]>
1 parent 3cdd382 commit 6a20908

File tree

12 files changed

+120
-69
lines changed

12 files changed

+120
-69
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/devcontainers/dotnet:1-9.0-bookworm
1+
FROM mcr.microsoft.com/devcontainers/dotnet:10.0
22

33
USER vscode
44

@@ -7,10 +7,3 @@ RUN dotnet tool install --global dotnet-ef \
77

88
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
99
CMD dotnet --info > /dev/null || exit 1
10-
11-
# [Optional] Uncomment this section to install additional OS packages.
12-
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
13-
# && apt-get -y install --no-install-recommends <your-package-list-here>
14-
15-
# [Optional] Uncomment this line to install global node packages.
16-
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1

.devcontainer/devcontainer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
66
"features": {
77
"ghcr.io/devcontainers/features/azure-cli:1": {
8-
"version": "2.72.0",
8+
"version": "latest",
99
"installBicep": true,
1010
"extensions": "serviceconnector-passwordless"
1111
},
1212
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
1313
"ghcr.io/devcontainers/features/dotnet:2": {
14-
"version": "lts"
14+
"version": "10.0",
15+
"additionalVersions": "8.0, 9.0"
1516
},
1617
"ghcr.io/devcontainers/features/github-cli:1": {}
1718
},

.github/linters/zizmor.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

.github/workflows/application.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ jobs:
3939

4040
steps:
4141
- name: Checkout
42-
uses: actions/[email protected]
42+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4343
with:
4444
persist-credentials: false
4545

4646
- name: Setup .NET
47-
uses: actions/[email protected]
47+
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
4848
with:
49-
dotnet-version: 9.0.x
49+
dotnet-version: 10.0.x
5050

5151
- name: Restore Packages
5252
run: dotnet restore
@@ -64,7 +64,7 @@ jobs:
6464
run: dotnet ef migrations script --idempotent --project src/MovieApi/ --startup-project src/MovieApi/ --no-build --output migrate.sql
6565

6666
- name: Upload Database Migrations Script
67-
uses: actions/[email protected]
67+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
6868
with:
6969
name: migrate.sql
7070
path: migrate.sql
@@ -89,12 +89,12 @@ jobs:
8989

9090
steps:
9191
- name: Checkout
92-
uses: actions/[email protected]
92+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
9393
with:
9494
persist-credentials: false
9595

9696
- name: Setup .NET
97-
uses: actions/[email protected]
97+
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
9898
with:
9999
dotnet-version: 9.0.x
100100

@@ -110,14 +110,14 @@ jobs:
110110
GITHUB_SHA: ${{ github.sha }}
111111

112112
- name: Azure Login
113-
uses: azure/[email protected]
113+
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
114114
with:
115115
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
116116
client-id: ${{ secrets.AZURE_CLIENT_ID }}
117117
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
118118

119119
- name: Get Variables
120-
uses: azure/[email protected]
120+
uses: azure/cli@9f7ce6f37c31b777ec6c6b6d1dfe7db79f497956 # v2.2.0
121121
with:
122122
inlineScript: |
123123
DATABASE_USER=${{ secrets.AZURE_CLIENT_DISPLAY_NAME }}
@@ -148,20 +148,20 @@ jobs:
148148
IMAGE_TAG: ${{ github.ref == 'refs/heads/main' && 'latest' || 'test' }}
149149

150150
- name: Download Database Migrations Script
151-
uses: actions/[email protected]
151+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
152152
with:
153153
name: migrate.sql
154154
path: .
155155

156156
- name: Apply Database Migrations
157-
uses: azure/postgresql@v1
157+
uses: azure/postgresql@59401b7890419c83f372819a1c37f5aecf57ac92 # v1.2.0
158158
with:
159159
connection-string: ${{ env.CONNECTION_STRING }}
160160
server-name: ${{ env.POSTGRESQL_SERVER }}
161161
plsql-file: migrate.sql
162162

163163
- name: Deploy Web App Container
164-
uses: azure/[email protected]
164+
uses: azure/webapps-deploy@657f0700ea5214d56a0400d8ac5e8023c963d25d # v3.0.6
165165
with:
166166
app-name: ${{ env.WEBAPP }}
167167
slot-name: staging
@@ -184,20 +184,20 @@ jobs:
184184

185185
steps:
186186
- name: Download Database Migrations Script
187-
uses: actions/[email protected]
187+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
188188
with:
189189
name: migrate.sql
190190
path: .
191191

192192
- name: Azure Login
193-
uses: azure/[email protected]
193+
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
194194
with:
195195
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
196196
client-id: ${{ secrets.AZURE_CLIENT_ID }}
197197
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
198198

199199
- name: Get Variables
200-
uses: azure/[email protected]
200+
uses: azure/cli@9f7ce6f37c31b777ec6c6b6d1dfe7db79f497956 # v2.2.0
201201
with:
202202
inlineScript: |
203203
DATABASE_USER=${{ secrets.AZURE_CLIENT_DISPLAY_NAME }}
@@ -213,14 +213,14 @@ jobs:
213213
echo "CONNECTION_STRING=$CONNECTION_STRING" >> "$GITHUB_ENV"
214214
215215
- name: Apply Database Migrations
216-
uses: azure/postgresql@v1
216+
uses: azure/postgresql@59401b7890419c83f372819a1c37f5aecf57ac92 # v1.2.0
217217
with:
218218
connection-string: ${{ env.CONNECTION_STRING }}
219219
server-name: ${{ env.POSTGRESQL_SERVER }}
220220
plsql-file: migrate.sql
221221

222222
- name: Swap Staging With Production
223-
uses: azure/[email protected]
223+
uses: azure/cli@9f7ce6f37c31b777ec6c6b6d1dfe7db79f497956 # v2.2.0
224224
with:
225225
inlineScript: |
226226
az webapp deployment slot swap --resource-group "$RESOURCE_GROUP" --name "$WEBAPP" --slot staging
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Dependency Review
3+
4+
"on":
5+
pull_request:
6+
types:
7+
- opened
8+
- synchronize
9+
- reopened
10+
11+
permissions: {}
12+
13+
jobs:
14+
review:
15+
name: Dependency Review
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
pull-requests: write
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
24+
with:
25+
persist-credentials: false
26+
27+
- name: Run Dependency Review
28+
uses: actions/dependency-review-action@56339e523c0409420f6c2c9a2f4292bbb3c07dd3 # v4.8.0
29+
with:
30+
comment-summary-in-pr: true

.github/workflows/infrastructure.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,26 @@ jobs:
3434

3535
steps:
3636
- name: Checkout
37-
uses: actions/[email protected]
37+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3838
with:
3939
persist-credentials: false
4040

4141
- name: Lint Bicep Files
42-
uses: azure/[email protected]
42+
uses: azure/cli@9f7ce6f37c31b777ec6c6b6d1dfe7db79f497956 # v2.2.0
4343
with:
4444
inlineScript: |
4545
az bicep lint --file infrastructure/main.bicep
4646
az bicep lint --file infrastructure/main.bicepparam
4747
4848
- name: Build Bicep Files
49-
uses: azure/[email protected]
49+
uses: azure/cli@9f7ce6f37c31b777ec6c6b6d1dfe7db79f497956 # v2.2.0
5050
with:
5151
inlineScript: |
5252
az bicep build --file infrastructure/main.bicep --outfile infrastructure/main.json
5353
az bicep build-params --file infrastructure/main.bicepparam --outfile infrastructure/main.parameters.json
5454
5555
- name: Upload Artifacts
56-
uses: actions/[email protected]
56+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
5757
with:
5858
name: infrastructure
5959
path: infrastructure/*.json
@@ -71,26 +71,26 @@ jobs:
7171

7272
steps:
7373
- name: Download Artifacts
74-
uses: actions/[email protected]
74+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
7575
with:
7676
name: infrastructure
7777
path: infrastructure/
7878

7979
- name: Azure Login
80-
uses: azure/[email protected]
80+
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
8181
with:
8282
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
8383
client-id: ${{ secrets.AZURE_CLIENT_ID }}
8484
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
8585

8686
- name: Create Resource Group
87-
uses: azure/[email protected]
87+
uses: azure/cli@9f7ce6f37c31b777ec6c6b6d1dfe7db79f497956 # v2.2.0
8888
with:
8989
inlineScript: |
9090
az group create --name "$RESOURCE_GROUP" --location "$LOCATION"
9191
9292
- name: Validate ARM Deployment
93-
uses: azure/arm-deploy@v2
93+
uses: azure/arm-deploy@a1361c2c2cd398621955b16ca32e01c65ea340f5 # v2
9494
with:
9595
scope: resourcegroup
9696
resourceGroupName: ${{ env.RESOURCE_GROUP }}
@@ -99,7 +99,7 @@ jobs:
9999
deploymentMode: Validate
100100

101101
- name: What-if ARM Deployment
102-
uses: azure/arm-deploy@v2
102+
uses: azure/arm-deploy@a1361c2c2cd398621955b16ca32e01c65ea340f5 # v2
103103
with:
104104
scope: resourcegroup
105105
resourceGroupName: ${{ env.RESOURCE_GROUP }}
@@ -121,27 +121,27 @@ jobs:
121121

122122
steps:
123123
- name: Download Artifacts
124-
uses: actions/[email protected]
124+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
125125
with:
126126
name: infrastructure
127127
path: infrastructure/
128128

129129
- name: Azure Login
130-
uses: azure/[email protected]
130+
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
131131
with:
132132
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
133133
client-id: ${{ secrets.AZURE_CLIENT_ID }}
134134
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
135135

136136
- name: Create Resource Group
137-
uses: azure/[email protected]
137+
uses: azure/cli@9f7ce6f37c31b777ec6c6b6d1dfe7db79f497956 # v2.2.0
138138
with:
139139
inlineScript: |
140140
az group create --name "$RESOURCE_GROUP" --location "$LOCATION"
141141
142142
- name: Deploy Resources
143143
id: deploy
144-
uses: azure/arm-deploy@v2
144+
uses: azure/arm-deploy@a1361c2c2cd398621955b16ca32e01c65ea340f5 # v2
145145
with:
146146
scope: resourcegroup
147147
resourceGroupName: ${{ env.RESOURCE_GROUP }}

.github/workflows/lint.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,23 @@ jobs:
2323

2424
steps:
2525
- name: Checkout Code
26-
uses: actions/[email protected]
26+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2727
with:
2828
fetch-depth: 0
2929
persist-credentials: true
3030

3131
- name: Super-Linter
32-
uses: super-linter/[email protected]
32+
uses: super-linter/super-linter@2bdd90ed3262e023ac84bf8fe35dc480721fc1f2 # v8.2.1
3333
env:
3434
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
VALIDATE_DOTNET_SLN_FORMAT_ANALYZERS: false # Not supported for .NET 10 yet
36+
VALIDATE_DOTNET_SLN_FORMAT_STYLE: false # Not supported for .NET 10 yet
3537
VALIDATE_GIT_COMMITLINT: false
3638
FIX_BIOME_FORMAT: true
3739
FIX_BIOME_LINT: true
3840
FIX_CSHARP: true
39-
FIX_DOTNET_SLN_FORMAT_ANALYZERS: true
40-
FIX_DOTNET_SLN_FORMAT_STYLE: true
41+
# FIX_DOTNET_SLN_FORMAT_ANALYZERS: true
42+
# FIX_DOTNET_SLN_FORMAT_STYLE: true
4143
FIX_DOTNET_SLN_FORMAT_WHITESPACE: true
4244
FIX_GITHUB_ACTIONS_ZIZMOR: true
4345
FIX_JSON_PRETTIER: true
@@ -51,7 +53,7 @@ jobs:
5153

5254
- name: Commit and push linting fixes
5355
if: github.event_name == 'pull_request' && github.ref_name != github.event.repository.default_branch
54-
uses: stefanzweifel/[email protected]
56+
uses: stefanzweifel/git-auto-commit-action@28e16e81777b558cc906c8750092100bbb34c5e3 # v7.0.0
5557
with:
5658
add_options: --update
5759
branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}

.github/workflows/zizmor.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: GitHub Actions Security Analysis with zizmor 🌈
3+
4+
"on":
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- .github/workflows/**
10+
pull_request:
11+
branches:
12+
- "**"
13+
paths:
14+
- .github/workflows/**
15+
16+
permissions: {}
17+
18+
jobs:
19+
zizmor:
20+
name: Run zizmor 🌈
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
actions: read
25+
security-events: write
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
29+
with:
30+
persist-credentials: false
31+
32+
- name: Run zizmor 🌈
33+
uses: zizmorcore/zizmor-action@e673c3917a1aef3c65c972347ed84ccd013ecda4 # v0.2.0
34+
with:
35+
persona: pedantic

0 commit comments

Comments
 (0)