Skip to content

update actions, and dotnet version - #255

Merged
grimley517 merged 9 commits into
mainfrom
254-build-actions-not-working
Apr 21, 2026
Merged

update actions, and dotnet version#255
grimley517 merged 9 commits into
mainfrom
254-build-actions-not-working

Conversation

@grimley517

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings April 20, 2026 18:05
@grimley517 grimley517 linked an issue Apr 20, 2026 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates GitHub Actions workflow dependencies (actions used) and bumps the CI .NET SDK version.

Changes:

  • Updated workflow actions to newer major versions across Sonar, release, and CI build workflows.
  • Updated .github/workflows/dotnet.yml to install .NET SDK 9.0.x instead of 6.0.x.
  • Updated artifact upload/download and caching actions to newer major versions.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
.github/workflows/sonar.yml Updates Java setup, checkout, and cache action references used by SonarCloud analysis.
.github/workflows/release.yml Updates checkout/.NET setup/artifact actions used for packaging, validation, testing, and publishing.
.github/workflows/dotnet.yml Updates checkout/.NET setup/artifact actions and changes the installed .NET SDK version for CI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yml
Comment on lines 37 to 43
# Install the .NET SDK indicated in the global.json file
- name: Setup .NET
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5

# Download the NuGet package created in the previous job
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v7
with:

Copilot AI Apr 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several run: steps in this workflow use PowerShell syntax (e.g., Get-ChildItem, foreach(...)), but the jobs run on ubuntu-latest and these steps don’t set shell: pwsh. Unless the shell is set, these commands will execute under bash and fail. Set defaults.run.shell: pwsh for the workflow/job, or rewrite those commands to bash equivalents.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit 91d7cff. Converted both PowerShell steps to bash equivalents: replaced (Get-ChildItem ...) with $(ls ...) for the validate step, and replaced the foreach(...) loop with a bash for ... do ... done loop (with the path properly quoted) for the publish step.

Comment thread .github/workflows/dotnet.yml Outdated
uses: actions/setup-dotnet@v5
with:
dotnet-version: 6.0.x
dotnet-version: 9.0.x

Copilot AI Apr 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repo’s projects target net6.0 (e.g., src/DecimalChecker/DecimalChecker.csproj). Installing only the .NET 9 SDK here can break dotnet test at runtime if the .NET 6 runtime isn’t available on the runner (newer SDKs don’t necessarily include older runtimes). Prefer installing the SDK/runtime matching the target framework (6.0.x), or install both 6.0.x and 9.0.x if you need 9 for tooling.

Suggested change
dotnet-version: 9.0.x
dotnet-version: 6.0.x

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot does setting a global.json solve this? can we remove the project setting to use dotnet 6 and rely on the global.json to set the dotnet version.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes — the combination of global.json (pinning the SDK to 9.0) and updating TargetFramework to net9.0 in the project files resolves the mismatch. Both were done in commit 163307f, so the SDK and runtime are now aligned and no explicit dotnet-version is needed in the workflows.

Comment thread .github/workflows/dotnet.yml
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/sonar.yml Outdated
…emove explicit dotnet-version from workflows

Agent-Logs-Url: https://github.com/grimley517/DecimalToSqlChecker/sessions/4972f1c7-9e47-4cbe-b2fe-9f40fecd7e44

Co-authored-by: grimley517 <1910463+grimley517@users.noreply.github.com>

@grimley517 grimley517 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice review @copilot. Can dotnet versions be declared in a single place as opposed in all project definitions?

Copilot AI and others added 2 commits April 20, 2026 18:26

Copilot AI commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

nice review @copilot. Can dotnet versions be declared in a single place as opposed in all project definitions?

Yes — done in commit edceeae. Added src/Directory.Build.props that declares <TargetFramework>net9.0</TargetFramework> once, and removed the per-project setting from both .csproj files. MSBuild automatically picks up Directory.Build.props for all projects under that directory.

@grimley517

Copy link
Copy Markdown
Owner Author

@copilot the sonarqube run is failing as it has no config file - can you create a config file for sonarqube please.

Copilot AI commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

@copilot the sonarqube run is failing as it has no config file - can you create a config file for sonarqube please.

Done in commit 96a06f2. Two changes were made:

  1. Added sonar-project.properties at the repo root with the project key, organization, host URL, and coverage report path.
  2. Fixed the root cause of the CI failure: the sonar.login parameter is deprecated in SonarScanner v7+ — updated both the begin and end commands in sonar.yml to use sonar.token instead.

@grimley517
grimley517 merged commit 00347b3 into main Apr 21, 2026
2 of 3 checks passed
@grimley517
grimley517 deleted the 254-build-actions-not-working branch April 21, 2026 05:00
@grimley517
grimley517 restored the 254-build-actions-not-working branch April 23, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build actions not working

3 participants