Skip to content

Upgrade GitHub Actions to Node.js 24-compatible versions#67

Merged
304NotModified merged 2 commits intomainfrom
copilot/update-actions-versions-node-24
Apr 7, 2026
Merged

Upgrade GitHub Actions to Node.js 24-compatible versions#67
304NotModified merged 2 commits intomainfrom
copilot/update-actions-versions-node-24

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

actions/checkout@v4 and actions/setup-dotnet@v4 run on Node.js 20, which is deprecated on GitHub Actions runners (removed September 16, 2026).

Changes

  • actions/checkout: v4v6 (v6.0.2, Node.js 24)
  • actions/setup-dotnet: v4v5 (v5.2.0, Node.js 24)

Applied to both .github/workflows/build.yml and .github/workflows/sonarcloud.yml.

Original prompt

Problem

The SonarCloud warning reports that actions/checkout@v4 and actions/setup-dotnet@v4 are running on Node.js 20, which is deprecated and will be removed from GitHub Actions runners on September 16th, 2026. Node.js 24 will become the default on June 2nd, 2026.

Files to Update

.github/workflows/sonarcloud.yml

  • Line 19: uses: actions/checkout@v4 → update to actions/checkout@v4 latest patch that supports Node.js 24, or pin to a newer version (e.g., actions/checkout@v4.2.2 or higher that uses Node.js 20+)
  • Line 24: uses: actions/setup-dotnet@v4 → update to latest version supporting Node.js 24

.github/workflows/build.yml

  • Line 18: uses: actions/checkout@v4 → update to latest version supporting Node.js 24
  • Line 21: uses: actions/setup-dotnet@v4 → update to latest version supporting Node.js 24

Fix

Check the latest releases of these actions on GitHub to find the versions that support Node.js 24:

Update both workflow files to use the latest versions of actions/checkout and actions/setup-dotnet that support Node.js 24.

Also consider adding FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true as an environment variable at the workflow level if the actions don't yet have a Node.js 24 version available.

Current workflow files content:

sonarcloud.yml (BlobSha: 381a934a68b3b967cc6f4ebd13ed56d61d750d75):

name: SonarCloud

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]
  workflow_dispatch:

jobs:
  sonarcloud:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write
      pull-requests: write

    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Setup .NET
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: 10.0.x

      - name: Install SonarScanner for .NET
        run: |
          dotnet tool install --global dotnet-sonarscanner
          dotnet tool install --global dotnet-coverage

      - name: Restore dependencies
        run: dotnet restore SLNX-validator.slnx

      - name: Begin SonarCloud analysis
        env:
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
        run: |
          dotnet sonarscanner begin \
            /k:"slnx-validator" \
            /o:"304notmodified" \
            /d:sonar.token="${SONAR_TOKEN}" \
            /d:sonar.host.url="https://sonarcloud.io" \
            /d:sonar.cs.vscoveragexml.reportsPaths="coverage.xml"

      - name: Build
        run: dotnet build SLNX-validator.slnx --no-incremental -c Release

      - name: Test with coverage
        run: dotnet-coverage collect "dotnet test --solution SLNX-validator.slnx --no-build -c Release --verbosity normal" -f xml -o coverage.xml

      - name: End SonarCloud analysis
        env:
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
        run: dotnet sonarscanner end /d:sonar.token="${SONAR_TOKEN}"

build.yml (BlobSha: 86db52043e33c8b3af55212da4eee1b7b29e6d93):

name: Build

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write

    steps:
      - uses: actions/checkout@v4

      - name: Setup .NET
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: 10.0.x

      - name: Restore dependencies
        run: dotnet restore SLNX-validator.slnx

      - name: Build
        run: dotnet build SLNX-validator.slnx --no-restore -c Release

      - name: Test
        run: dotnet test --solution SLNX-validator.slnx --no-build -c Release --verbosity normal

      - name: Determine version suffix
        id: version
        run: |
          if [[ "$GITHUB_REF" == "refs/heads/main" ]]; then
            echo "suffix=" >> $GITHUB_OUTPUT
          else
            CLEAN=$(echo "$GITHUB_REF_NAME" | sed 's/[^a-zA-Z0-9]/-/g' | sed 's/-\+/-/g' | sed 's/^-//;s/-$//')
            echo "suffix=$CLEAN" >> $GITHUB_OUTPUT
          fi

      - name: Pack
        run: |
          VERSION_SUFFIX="${{ steps.version.outputs.suffix }}"
          if [ -n "$VERSION_SUFFIX" ]; then
            dotnet pack SLNX-validator.slnx --no-build -c Release --output artifacts --version-suffix "$VERSION_SUFFIX"
          else
            dotnet pack SLNX-validator.slnx --no-build -c Release --output artifacts
          fi

      - name: Upload nuget package
        uses: actions/upload-artifact@v6
        with:
          compression-level: 0
          name: nupkg
          path: artifacts/*.nupkg

      - name: NuGet login
        if: github.r...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

*This pull request was created from Copilot chat.*
>

Copilot AI changed the title [WIP] Update actions versions for Node.js 24 support Upgrade GitHub Actions to Node.js 24-compatible versions Apr 7, 2026
Copilot AI requested a review from 304NotModified April 7, 2026 21:22
@304NotModified 304NotModified added the build CI build stuff label Apr 7, 2026
@304NotModified 304NotModified marked this pull request as ready for review April 7, 2026 21:27
@304NotModified 304NotModified merged commit 5bc1edd into main Apr 7, 2026
5 checks passed
@304NotModified 304NotModified deleted the copilot/update-actions-versions-node-24 branch April 7, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build CI build stuff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants