Skip to content

Fix deprecated GitHub Actions: update cache v1→v4, upload/download-artifact v2→v4#164

Merged
Skyzi000 merged 3 commits intodevelopfrom
copilot/fix-66d690d6-5965-4512-bae7-3a7f29624bd1
Aug 30, 2025
Merged

Fix deprecated GitHub Actions: update cache v1→v4, upload/download-artifact v2→v4#164
Skyzi000 merged 3 commits intodevelopfrom
copilot/fix-66d690d6-5965-4512-bae7-3a7f29624bd1

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Aug 30, 2025

This PR fixes the GitHub Actions workflow failures caused by deprecated action versions that are no longer supported.

Issue

The build workflow was failing with the following errors:

  • actions/cache: v1 is deprecated and causing automatic failures
  • actions/upload-artifact: v2 is deprecated and causing automatic failures

Changes Made

Updated the following actions in .github/workflows/build.yml to their latest supported versions:

  • actions/cache: v1v4 (2 instances)
    • SonarCloud packages cache (line 98)
    • SonarCloud scanner cache (line 107)
  • actions/upload-artifact: v2v4 (line 170)
    • Build artifacts upload step
  • actions/download-artifact: v2v4 (line 201)
    • Build artifacts download step in release job

Validation

  • ✅ YAML syntax validation passed for both workflow files
  • ✅ All deprecated actions have been updated to supported versions
  • ✅ No breaking changes to workflow functionality

These updates ensure the CI/CD pipeline continues to work without interruption and follows GitHub's current best practices for action usage.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…tifact v2→v4

Co-authored-by: Skyzi000 <38061609+Skyzi000@users.noreply.github.com>
Copilot AI changed the title [WIP] このエラーを修正して Error: This request has been automatically failed because it uses a deprecated version of actions/cache: v1. Please update your workflow to use v3/v4 of actions/cache to avoid interruptions. Learn more: https://github.b... Fix deprecated GitHub Actions: update cache v1→v4, upload/download-artifact v2→v4 Aug 30, 2025
Copilot AI requested a review from Skyzi000 August 30, 2025 16:03
Updated build workflow to use dotnet-sonarscanner and removed JDK setup.
@github-advanced-security
Copy link
Copy Markdown

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@Skyzi000 Skyzi000 marked this pull request as ready for review August 30, 2025 16:57
Copilot AI review requested due to automatic review settings August 30, 2025 16:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates deprecated GitHub Actions in the CI/CD workflow to their latest supported versions to resolve build failures and maintain workflow compatibility.

Key changes:

  • Updated actions/cache from v1 to v4
  • Updated actions/upload-artifact and actions/download-artifact from v2 to v4
  • Refactored SonarCloud integration to use global tool installation instead of caching

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +93 to 95
uses: actions/cache@v4
with:
path: ~\sonar\cache
Copy link

Copilot AI Aug 30, 2025

Choose a reason for hiding this comment

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

The cache path uses Windows-style path syntax (~\sonar\cache) but should use forward slashes for cross-platform compatibility. Change to ~/sonar/cache.

Suggested change
uses: actions/cache@v4
with:
path: ~\sonar\cache
path: ~/sonar/cache

Copilot uses AI. Check for mistakes.
Comment on lines +176 to 179
uses: actions/upload-artifact@v4
with:
name: Win-x64-${{ matrix.configuration }}-${{ github.sha }}
path: bin\x64\${{ matrix.configuration }}\net6.0-windows\win-x64\publish\
Copy link

Copilot AI Aug 30, 2025

Choose a reason for hiding this comment

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

The artifact path uses Windows-style backslashes which may cause issues. Consider using forward slashes: bin/x64/${{ matrix.configuration }}/net6.0-windows/win-x64/publish/

Suggested change
uses: actions/upload-artifact@v4
with:
name: Win-x64-${{ matrix.configuration }}-${{ github.sha }}
path: bin\x64\${{ matrix.configuration }}\net6.0-windows\win-x64\publish\
path: bin/x64/${{ matrix.configuration }}/net6.0-windows/win-x64/publish/

Copilot uses AI. Check for mistakes.
@Skyzi000 Skyzi000 merged commit 0ecf4a8 into develop Aug 30, 2025
6 of 8 checks passed
@Skyzi000 Skyzi000 deleted the copilot/fix-66d690d6-5965-4512-bae7-3a7f29624bd1 branch August 30, 2025 17:00
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.

4 participants