Skip to content

Commit 625e7d3

Browse files
committed
Update GHA workflow
1 parent bd55e3a commit 625e7d3

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

.github/workflows/build-container.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ jobs:
3232
- name: Checkout repository
3333
uses: actions/checkout@v4
3434

35+
- name: Set up .NET
36+
uses: actions/setup-dotnet@v4
37+
with:
38+
dotnet-version: '9.x'
39+
3540
- name: Pull the latest metadata.json
3641
if: inputs.image_name == 'awesome-copilot'
3742
shell: bash
@@ -81,6 +86,14 @@ jobs:
8186
git push origin main
8287
fi
8388
89+
- name: Build app
90+
if: env.BUILD_IMAGE == 'true' || inputs.force == true
91+
shell: bash
92+
run: |
93+
pushd ${{ inputs.image_name }}
94+
dotnet restore && dotnet build
95+
popd
96+
8497
- name: Check if Dockerfile exists
8598
if: env.BUILD_IMAGE == 'true' || inputs.force == true
8699
id: check-dockerfile
@@ -126,7 +139,7 @@ jobs:
126139
with:
127140
platforms: linux/amd64,linux/arm64
128141
push: true
129-
context: ${{ github.workspace }}/${{ inputs.image_name }}
142+
context: ${{ github.workspace }}
130143
file: ${{ github.workspace }}/Dockerfile.${{ inputs.image_name }}
131144
tags: '${{ steps.meta.outputs.tags }},${{ env.REGISTRY }}/${{ env.REPOSITORY }}/${{ inputs.image_name }}:latest'
132145
labels: ${{ steps.meta.outputs.labels }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Model Context Protocol .NET Samples
22

3-
[![Azure AI Community Discord](https://dcbadge.vercel.app/api/server/ByRwuEEgH4)](https://discord.com/invite/ByRwuEEgH4)
3+
[![Azure AI Community Discord](https://dcbadge.limes.pink/api/server/ByRwuEEgH4)](https://discord.com/invite/ByRwuEEgH4)
44

55
## 🚀 Introduction
66

todo-list/src/McpSamples.TodoList.HybridApp/Repositories/TodoRepository.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public async Task<TodoItem> UpdateTodoItemAsync(TodoItem todoItem)
7474
.ConfigureAwait(false);
7575
if (record is null)
7676
{
77-
return null;
77+
return default!;
7878
}
7979

8080
record.Text = todoItem.Text;
@@ -95,7 +95,7 @@ public async Task<TodoItem> CompleteTodoItemAsync(TodoItem todoItem)
9595
.ConfigureAwait(false);
9696
if (record is null)
9797
{
98-
return null;
98+
return default!;
9999
}
100100

101101
record.IsCompleted = todoItem.IsCompleted;
@@ -116,7 +116,7 @@ public async Task<TodoItem> DeleteTodoItemAsync(int id)
116116
.ConfigureAwait(false);
117117
if (record is null)
118118
{
119-
return null;
119+
return default!;
120120
}
121121

122122
await db.TodoItems.Where(p => p.Id == id)

0 commit comments

Comments
 (0)