Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "nuget" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
commit-message:
prefix: "CONFIG"
labels:
- "dependencies"
ignore:
- dependency-name: "FluentAssertions"
versions: ["8.x", "9.x", "10.x", "*"]
12 changes: 5 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ on:
- synchronize
- reopened
- closed
branches:
- main
jobs:
build:
name: Build
Expand All @@ -19,9 +17,9 @@ jobs:
- name: Enable long paths for Git
run: git config --system core.longpaths true
- name: Check out
uses: actions/checkout@v3
uses: actions/checkout@v5
- name: Setup .Net
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.100
- name: Restore
Expand Down Expand Up @@ -62,7 +60,7 @@ jobs:
contains(github.event.pull_request.labels.*.name, 'RELEASES')
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v5
with:
token: ${{ secrets.PAT_FOR_TAGGING }}
- name: Configure Git
Expand Down Expand Up @@ -135,9 +133,9 @@ jobs:
if: needs.add_tag.result == 'success'
steps:
- name: Check out
uses: actions/checkout@v3
uses: actions/checkout@v5
- name: Setup .Net
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.100
- name: Restore
Expand Down
62 changes: 50 additions & 12 deletions .github/workflows/prLinter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ jobs:
label:
name: Label
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Apply Label
uses: actions/github-script@v6
uses: actions/github-script@v8
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: >-
Expand Down Expand Up @@ -84,17 +85,17 @@ jobs:
}
permissions:
contents: read
pull-requests: write
issues: write
pull-requests: write
requireIssueOrTask:
name: Require Issue Or Task Association
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
uses: actions/checkout@v5
- name: Get PR Information
id: get_pr_info
uses: actions/github-script@v6
uses: actions/github-script@v8
with:
script: >2-
const pr = await github.rest.pulls.get({
Expand All @@ -111,20 +112,18 @@ jobs:
console.log(`PR Body: ${prBody}`);
- name: Check For Associated Issues Or Tasks
id: check_for_issues_or_tasks
if: ${{ steps.get_pr_info.outputs.prOwner != 'dependabot[bot]' }}
if: ${{ !contains(',dependabot[bot],', format(',{0},', steps.get_pr_info.outputs.prOwner)) }}
env:
PR_BODY: ${{ steps.get_pr_info.outputs.description }}
run: >2-
PR_BODY="${{ steps.get_pr_info.outputs.description }}"
echo "::notice::Raw PR Body: $PR_BODY"

if [[ -z "$PR_BODY" ]]; then
if [[ -z "${PR_BODY:-}" ]]; then
echo "Error: PR description does not contain any links to issue(s)/task(s) (e.g., 'closes #123' / 'closes AB#123' / 'fixes #123' / 'fixes AB#123')."
exit 1
fi

PR_BODY=$(echo "$PR_BODY" | tr -s '\r\n' ' ' | tr '\n' ' ' | xargs)
echo "::notice::Normalized PR Body: $PR_BODY"
NORMALIZED_PR_BODY=$(printf '%s' "$PR_BODY" | tr '\r\n' ' ' | tr -s ' ')

if echo "$PR_BODY" | grep -Piq "((close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved)\s*(\[#\d+\]|\#\d+)|(?:close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved)\s*(\[AB#\d+\]|AB#\d+))"; then
if printf '%s' "$NORMALIZED_PR_BODY" | grep -Piq "(close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved)\s*(\[#[0-9]+\]|#[0-9]+|\[AB#[0-9]+\]|AB#[0-9]+)"; then
echo "Valid PR description."
else
echo "Error: PR description does not contain any links to issue(s)/task(s) (e.g., 'closes #123' / 'closes AB#123' / 'fixes #123' / 'fixes AB#123')."
Expand All @@ -134,3 +133,42 @@ jobs:
permissions:
contents: read
pull-requests: read
setAuthorAsPrAssignee:
name: Set Author As PR Assignee
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Set Author As PR Assignee
uses: actions/github-script@v8
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: >
const pr = context.payload.pull_request;

if (!pr) {
console.log('No pull request context available.');
return;
}


const author = pr.user.login;

if (author.endsWith('[bot]')) {
console.log(`Skipping bot author: ${author}`);
return;
}


console.log(`Assigning PR to author: ${author}`);


await github.rest.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
assignees: [author]
});
permissions:
contents: read
issues: write
pull-requests: write
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ADotNet" Version="4.3.0" />
<PackageReference Include="ADotNet" Version="5.0.0" />
<PackageReference Include="FluentAssertions" Version="[7.2.2]" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using ADotNet.Clients;
using ADotNet.Models.Pipelines.GithubPipelines.DotNets;
using ADotNet.Models.Pipelines.GithubPipelines.DotNets.Tasks;
using ADotNet.Models.Pipelines.GithubPipelines.DotNets.Tasks.SetupDotNetTaskV3s;
using ADotNet.Models.Pipelines.GithubPipelines.DotNets.Tasks.SetupDotNetTaskV5s;

namespace NHSDigital.ApiPlatform.Infrastructure.Services
{
Expand All @@ -30,8 +30,7 @@ public void GenerateBuildScript(string branchName, string projectName, string do

PullRequest = new PullRequestEvent
{
Types = ["opened", "synchronize", "reopened", "closed"],
Branches = [branchName]
Types = ["opened", "synchronize", "reopened", "closed"]
}
},

Expand All @@ -52,16 +51,16 @@ public void GenerateBuildScript(string branchName, string projectName, string do
Run = "git config --system core.longpaths true"
},

new CheckoutTaskV3
new CheckoutTaskV5
{
Name = "Check out"
},

new SetupDotNetTaskV3
new SetupDotNetTaskV5
{
Name = "Setup .Net",

With = new TargetDotNetVersionV3
With = new TargetDotNetVersionV5
{
DotNetVersion = dotNetVersion
}
Expand Down Expand Up @@ -108,7 +107,7 @@ dotnet test $project.FullName --no-build --verbosity normal
},
{
"add_tag",
new TagJob(
new TagJobV2(
runsOn: BuildMachines.UbuntuLatest,
dependsOn: "build",
projectRelativePath: $"{projectName}/{projectName}.csproj",
Expand All @@ -120,7 +119,7 @@ dotnet test $project.FullName --no-build --verbosity normal
},
{
"publish",
new PublishJobV2(
new PublishJobV4(
runsOn: BuildMachines.UbuntuLatest,
dependsOn: "add_tag",
dotNetVersion: dotNetVersion,
Expand Down Expand Up @@ -164,24 +163,25 @@ public void GeneratePrLintScript(string branchName)
{
{
"label",
new LabelJobV2(runsOn: BuildMachines.UbuntuLatest)
new LabelJobV3(runsOn: BuildMachines.UbuntuLatest)
{
Name = "Label",
Permissions = new Dictionary<string, string>
{
{ "contents", "read" },
{ "pull-requests", "write" },
{ "issues", "write" }
}
Name = "Label"
}
},
{
"requireIssueOrTask",
new RequireIssueOrTaskJob()
new RequireIssueOrTaskJobV2(excludedAuthors: "dependabot[bot]")
{
Name = "Require Issue Or Task Association",
}
},
{
"setAuthorAsPrAssignee",
new SetAuthorAsPrAssigneeJobV2(runsOn: BuildMachines.UbuntuLatest)
{
Name = "Set Author As PR Assignee",
}
},
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="[7.2.2]" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.7.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="Tynamix.ObjectFiller" Version="1.5.9" />
<PackageReference Include="WireMock.Net" Version="2.6.0" />
<PackageReference Include="WireMock.Net" Version="2.12.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="10.0.8" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="10.0.8" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="10.0.8" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.8" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
<PackageReference Include="WireMock.Net" Version="2.6.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="10.0.9" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="10.0.9" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="10.0.9" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.9" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.7.0" />
<PackageReference Include="WireMock.Net" Version="2.12.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="[7.2.2]" />
<PackageReference Include="Hl7.Fhir.STU3" Version="6.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
<PackageReference Include="Hl7.Fhir.STU3" Version="6.2.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.7.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="Tynamix.ObjectFiller" Version="1.5.9" />
<PackageReference Include="xunit" Version="2.9.3" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="[7.2.2]" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.7.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="Tynamix.ObjectFiller" Version="1.5.9" />
<PackageReference Include="WireMock.Net" Version="2.6.0" />
<PackageReference Include="WireMock.Net" Version="2.12.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="10.0.8" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="10.0.8" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="10.0.8" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.8" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
<PackageReference Include="WireMock.Net" Version="2.6.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="10.0.9" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="10.0.9" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="10.0.9" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.9" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.7.0" />
<PackageReference Include="WireMock.Net" Version="2.12.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="[7.2.2]" />
<PackageReference Include="Hl7.Fhir.STU3" Version="6.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
<PackageReference Include="Hl7.Fhir.STU3" Version="6.2.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.7.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="Tynamix.ObjectFiller" Version="1.5.9" />
<PackageReference Include="xunit" Version="2.9.3" />
Expand Down
4 changes: 2 additions & 2 deletions NHSDigital.ApiPlatform.Sdk/NHSDigital.ApiPlatform.Sdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.8" />
<PackageReference Include="Microsoft.Extensions.Http" Version="10.0.8" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.9" />
<PackageReference Include="Microsoft.Extensions.Http" Version="10.0.9" />
<PackageReference Include="Xeption" Version="2.9.0" />
<PackageReference Include="ISL.Providers.PDS.Abstractions" Version="1.0.0.8" />
<PackageReference Include="ISL.Providers.PDS.FakeFHIR" Version="1.0.0.8" />
Expand Down
Loading