-
Notifications
You must be signed in to change notification settings - Fork 636
Enhance workflow for Go setup and caching #704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Updated GitHub Actions workflow for Go and Webpack builds, including caching and version management.
There was a problem hiding this 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 pull request attempts to add a new GitHub Actions workflow file for automating builds and tests for Node.js (with Webpack) and Go projects. However, the workflow file contains critical structural issues that prevent it from being a valid GitHub Actions workflow.
Key Issues:
- The YAML structure is fundamentally broken with multiple disconnected sections, duplicate job declarations, and improperly formatted content
- Non-existent action versions are referenced (checkout@v6, cache/restore@v5)
- Non-existent Go versions are specified (1.24.10, 1.24.0-rc.1, 1.23.0-beta.1)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| permissions: | ||
| contents: read # Required to checkout code and install dependencies | ||
|
|
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line contains a "permissions:" keyword that is improperly placed within the workflow file. The "permissions" should be defined at the workflow level or job level, not floating at line 231 after other content. This will cause YAML parsing errors.
| permissions: | |
| contents: read # Required to checkout code and install dependencies | |
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.23' | ||
| - run: go version | ||
| go 1.23.0 // Minimum required version | ||
| toolchain go1.23.2 // V6 uses this exact version | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.23' | ||
| - run: go run hello.go | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '>=1.22.0' | ||
| - run: go version | ||
| go-version: '^1.23.1' # The Go version to download (if necessary) and use. | ||
| - run: go version | ||
| go-version: '1.22' # Correct | ||
| go-version: 1.22 # Incorrect - YAML parser interprets as 1.2 | ||
| # RC version | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.24.0-rc.1' # The Go version to download (if necessary) and use | ||
| - run: go version | ||
| # Beta version | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.23.0-beta.1' # The Go version to download (if necessary) and use | ||
| - run: go version | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: 'stable' # Latest stable version | ||
| - run: go version | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: 'oldstable' # Previous stable version | ||
| - run: go version | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: 'go.mod' | ||
| - run: go version | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: 'go.work' | ||
| - run: go version | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: '.go-version' | ||
| - run: go version | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: '.tool-versions' | ||
| - run: go version | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.23' | ||
| check-latest: true # Always check for the latest patch release | ||
| - run: go version | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.23' | ||
| # cache: true (default) | ||
| - run: go run hello.go | ||
| const cache = require('@actions/cache'); | ||
| const paths = [ | ||
| 'node_modules', | ||
| 'packages/*/node_modules/' | ||
| ] | ||
| const key = 'npm-foobar-d5ea0750' | ||
| const cacheId = await cache.saveCache(paths, key) | ||
| const cache = require('@actions/cache'); | ||
| const paths = [ | ||
| 'node_modules', | ||
| 'packages/*/node_modules/' | ||
| ] | ||
| const key = 'npm-foobar-d5ea0750' | ||
| const restoreKeys = [ | ||
| 'npm-foobar-', | ||
| 'npm-' | ||
| ] | ||
| const cacheKey = await cache.restoreCache(paths, key, restoreKeys) | ||
| # In some workflows, you may want to restore a cache without saving it. This can help reduce cache writes and storage usage in workflows that only need to read from cache | ||
| jobs: | ||
| build: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest, windows-latest] | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - name: Setup Go | ||
| id: setup-go | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.24.10' | ||
| cache: false | ||
| # Capture Go cache locations | ||
| - name: Set Go cache variables (Linux/macOS) | ||
| if: runner.os != 'Windows' | ||
| run: | | ||
| echo "GO_MOD_CACHE=$(go env GOMODCACHE)" >> $GITHUB_ENV | ||
| echo "GO_BUILD_CACHE=$(go env GOCACHE)" >> $GITHUB_ENV | ||
| - name: Set Go cache variables (Windows) | ||
| if: runner.os == 'Windows' | ||
| shell: pwsh | ||
| run: | | ||
| echo "GO_MOD_CACHE=$(go env GOMODCACHE)" | Out-File $env:GITHUB_ENV -Append | ||
| echo "GO_BUILD_CACHE=$(go env GOCACHE)" | Out-File $env:GITHUB_ENV -Append | ||
| # Normalize runner.arch to lowercase to ensure consistent cache keys | ||
| - name: Normalize runner architecture (Linux/macOS) | ||
| if: runner.os != 'Windows' | ||
| shell: bash | ||
| run: echo "ARCH=$(echo '${{ runner.arch }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | ||
| - name: Normalize runner architecture (Windows) | ||
| if: runner.os == 'Windows' | ||
| shell: pwsh | ||
| run: | | ||
| $arch = "${{ runner.arch }}".ToLower() | ||
| echo "ARCH=$arch" | Out-File $env:GITHUB_ENV -Append | ||
| - name: Set cache OS suffix for Linux | ||
| if: runner.os == 'Linux' | ||
| shell: bash | ||
| run: echo "CACHE_OS_SUFFIX=$ImageOS-" >> $GITHUB_ENV | ||
| - name: Restore Go cache | ||
| id: go-cache | ||
| uses: actions/cache/restore@v5 | ||
| with: | ||
| path: | | ||
| ${{ env.GO_MOD_CACHE }} | ||
| ${{ env.GO_BUILD_CACHE }} | ||
| key: setup-go-${{ runner.os }}-${{ env.ARCH }}-${{ env.CACHE_OS_SUFFIX }}go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('**/go.sum') }} | ||
| - name: Download modules | ||
| run: go mod download | ||
| - name: Build | ||
| run: go build ./... | ||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| go-version: ['1.21', '1.22', '1.23'] | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: ${{ matrix.go-version }} | ||
| - run: go test ./...1.23.2 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| # Version or version range of Go to use | ||
| go-version: '1.23' | ||
|
|
||
| # Path to go.mod, go.work, .go-version, or .tool-versions file | ||
| go-version-file: 'go.mod' | ||
|
|
||
| # Check for latest version | ||
| check-latest: false | ||
|
|
||
| # GitHub token for authentication | ||
| token: ${{ github.token }} | ||
|
|
||
| # Enable/disable caching | ||
| cache: true | ||
|
|
||
| # Path to dependency files for caching | ||
| cache-dependency-path: 'go.sum' | ||
|
|
||
| # Architecture to install (auto-detected if not specified) | ||
| architecture: 'x64' | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| token: ${{ secrets.GH_DOTCOM_TOKEN }} | ||
| go-version: '1.23' | ||
| permissions: | ||
| contents: read # Required to checkout code and install dependencies | ||
|
|
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The entire workflow file has a fundamentally broken structure. It appears to be a collection of disconnected examples and code snippets rather than a valid GitHub Actions workflow. The file mixes actual workflow configuration (lines 1-28), floating step definitions without job containers, JavaScript code examples, duplicate job declarations, and improperly formatted documentation. The workflow needs to be completely restructured with proper YAML hierarchy: a single jobs section containing job definitions, each with runs-on and steps properties.
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.23' | ||
| - run: go version | ||
| go 1.23.0 // Minimum required version | ||
| toolchain go1.23.2 // V6 uses this exact version | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.23' | ||
| - run: go run hello.go | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '>=1.22.0' | ||
| - run: go version | ||
| go-version: '^1.23.1' # The Go version to download (if necessary) and use. | ||
| - run: go version | ||
| go-version: '1.22' # Correct | ||
| go-version: 1.22 # Incorrect - YAML parser interprets as 1.2 | ||
| # RC version | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.24.0-rc.1' # The Go version to download (if necessary) and use | ||
| - run: go version | ||
| # Beta version | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines contain workflow step configuration that is not properly structured within a job. The "steps:" keyword at line 29 appears to be floating without a parent job definition, and the subsequent step definitions (lines 30-34) are not properly indented or organized within the workflow structure. This is invalid YAML for GitHub Actions workflows.
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.23' | |
| - run: go version | |
| go 1.23.0 // Minimum required version | |
| toolchain go1.23.2 // V6 uses this exact version | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.23' | |
| - run: go run hello.go | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: '>=1.22.0' | |
| - run: go version | |
| go-version: '^1.23.1' # The Go version to download (if necessary) and use. | |
| - run: go version | |
| go-version: '1.22' # Correct | |
| go-version: 1.22 # Incorrect - YAML parser interprets as 1.2 | |
| # RC version | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.24.0-rc.1' # The Go version to download (if necessary) and use | |
| - run: go version | |
| # Beta version | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: |
| go 1.23.0 // Minimum required version | ||
| toolchain go1.23.2 // V6 uses this exact version |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines appear to be comments or documentation examples but are not properly formatted as YAML comments. Lines 35-36 should be prefixed with '#' to be valid comments, otherwise they will cause YAML parsing errors.
| go 1.23.0 // Minimum required version | |
| toolchain go1.23.2 // V6 uses this exact version | |
| # go 1.23.0 // Minimum required version | |
| # toolchain go1.23.2 // V6 uses this exact version |
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: ${{ matrix.go-version }} | ||
| - run: go test ./...1.23.2 |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This run command is malformed. Line 204 shows "go test ./...1.23.2" which appears to have the version number appended directly to the test path. This should likely be "go test ./..." on a separate line from any version specification.
| - run: go test ./...1.23.2 | |
| - run: go test ./... |
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.23' | ||
| - run: go version | ||
| go 1.23.0 // Minimum required version | ||
| toolchain go1.23.2 // V6 uses this exact version | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.23' | ||
| - run: go run hello.go | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '>=1.22.0' | ||
| - run: go version | ||
| go-version: '^1.23.1' # The Go version to download (if necessary) and use. | ||
| - run: go version | ||
| go-version: '1.22' # Correct | ||
| go-version: 1.22 # Incorrect - YAML parser interprets as 1.2 | ||
| # RC version | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.24.0-rc.1' # The Go version to download (if necessary) and use | ||
| - run: go version | ||
| # Beta version | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These step definitions are not properly organized within a job structure. Each "steps:" block (lines 37, 43, 47, etc.) should be part of a job definition with a job name and "runs-on" specification. These floating step blocks will cause workflow validation to fail.
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.23' | |
| - run: go version | |
| go 1.23.0 // Minimum required version | |
| toolchain go1.23.2 // V6 uses this exact version | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.23' | |
| - run: go run hello.go | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: '>=1.22.0' | |
| - run: go version | |
| go-version: '^1.23.1' # The Go version to download (if necessary) and use. | |
| - run: go version | |
| go-version: '1.22' # Correct | |
| go-version: 1.22 # Incorrect - YAML parser interprets as 1.2 | |
| # RC version | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.24.0-rc.1' # The Go version to download (if necessary) and use | |
| - run: go version | |
| # Beta version | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: |
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.23' | ||
| - run: go version | ||
| go 1.23.0 // Minimum required version | ||
| toolchain go1.23.2 // V6 uses this exact version | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.23' | ||
| - run: go run hello.go | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '>=1.22.0' | ||
| - run: go version | ||
| go-version: '^1.23.1' # The Go version to download (if necessary) and use. | ||
| - run: go version | ||
| go-version: '1.22' # Correct | ||
| go-version: 1.22 # Incorrect - YAML parser interprets as 1.2 | ||
| # RC version | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.24.0-rc.1' # The Go version to download (if necessary) and use | ||
| - run: go version | ||
| # Beta version | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.23.0-beta.1' # The Go version to download (if necessary) and use | ||
| - run: go version | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines contain inconsistent YAML formatting. Line 53 appears to be a property assignment continuing from above but is improperly placed. Line 54 is an orphaned "- run:" command. Lines 55-56 are documentation comments that should be prefixed with '#'. This entire section lacks proper structure.
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.23' | |
| - run: go version | |
| go 1.23.0 // Minimum required version | |
| toolchain go1.23.2 // V6 uses this exact version | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.23' | |
| - run: go run hello.go | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: '>=1.22.0' | |
| - run: go version | |
| go-version: '^1.23.1' # The Go version to download (if necessary) and use. | |
| - run: go version | |
| go-version: '1.22' # Correct | |
| go-version: 1.22 # Incorrect - YAML parser interprets as 1.2 | |
| # RC version | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.24.0-rc.1' # The Go version to download (if necessary) and use | |
| - run: go version | |
| # Beta version | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.23.0-beta.1' # The Go version to download (if necessary) and use | |
| - run: go version | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| # --------------------------------------------------------------------------- | |
| # The following are example snippets for actions/setup-go usage. | |
| # They are kept here as documentation only and are not part of this workflow. | |
| # | |
| # steps: | |
| # - uses: actions/checkout@v5 | |
| # - uses: actions/setup-go@v6 | |
| # with: | |
| # go-version: '1.23' | |
| # - run: go version | |
| # # go 1.23.0 // Minimum required version | |
| # # toolchain go1.23.2 // V6 uses this exact version | |
| # | |
| # steps: | |
| # - uses: actions/checkout@v5 | |
| # - uses: actions/setup-go@v6 | |
| # with: | |
| # go-version: '1.23' | |
| # - run: go run hello.go | |
| # | |
| # steps: | |
| # - uses: actions/checkout@v5 | |
| # - uses: actions/setup-go@v6 | |
| # with: | |
| # go-version: '>=1.22.0' | |
| # - run: go version | |
| # # go-version: '^1.23.1' # The Go version to download (if necessary) and use. | |
| # # go-version: '1.22' # Correct | |
| # # go-version: 1.22 # Incorrect - YAML parser interprets as 1.2 | |
| # | |
| # # RC version | |
| # steps: | |
| # - uses: actions/checkout@v5 | |
| # - uses: actions/setup-go@v6 | |
| # with: | |
| # go-version: '1.24.0-rc.1' # The Go version to download (if necessary) and use | |
| # - run: go version | |
| # | |
| # # Beta version | |
| # steps: | |
| # - uses: actions/checkout@v5 | |
| # - uses: actions/setup-go@v6 | |
| # with: | |
| # go-version: '1.23.0-beta.1' # The Go version to download (if necessary) and use | |
| # - run: go version | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: |
| with: | ||
| go-version: '1.24.0-rc.1' # The Go version to download (if necessary) and use | ||
| - run: go version | ||
| # Beta version |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment at line 64 is not properly formatted. It appears to be attempting to describe what comes next, but comments in YAML must start with '#'. Line 64 should be "# Beta version" instead of " # Beta version" (note the indentation issue).
| # Beta version | |
| # Beta version |
| const cache = require('@actions/cache'); | ||
| const paths = [ | ||
| 'node_modules', | ||
| 'packages/*/node_modules/' | ||
| ] | ||
| const key = 'npm-foobar-d5ea0750' | ||
| const cacheId = await cache.saveCache(paths, key) | ||
| const cache = require('@actions/cache'); | ||
| const paths = [ | ||
| 'node_modules', | ||
| 'packages/*/node_modules/' | ||
| ] | ||
| const key = 'npm-foobar-d5ea0750' | ||
| const restoreKeys = [ | ||
| 'npm-foobar-', | ||
| 'npm-' | ||
| ] | ||
| const cacheKey = await cache.restoreCache(paths, key, restoreKeys) |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines contain JavaScript/Node.js code snippets in the middle of a GitHub Actions YAML workflow file. This code (lines 121-138) appears to be documentation examples showing how to use the @actions/cache library, but it's not properly formatted as comments or code blocks. This will cause YAML parsing to fail.
| 'npm-' | ||
| ] | ||
| const cacheKey = await cache.restoreCache(paths, key, restoreKeys) | ||
| # In some workflows, you may want to restore a cache without saving it. This can help reduce cache writes and storage usage in workflows that only need to read from cache |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment line is not properly formatted as a YAML comment within the workflow. The text at line 139 should either be prefixed with '#' or removed, as it will cause parsing issues in the workflow file.
This pull request introduces a new GitHub Actions workflow in
.github/workflows/webpack.ymlto automate build and test processes for Node.js (with Webpack) and Go projects. The workflow adds comprehensive examples for setting up multiple Node.js and Go versions, demonstrates advanced caching strategies, and provides detailed configuration options for Go environments.The most important changes are:
Workflow Automation and Build Enhancements:
.github/workflows/webpack.yml) that triggers on pushes and pull requests to themainbranch, automating builds for Node.js (with Webpack) and Go projects across multiple versions and operating systems.Go Environment and Caching Improvements:
go.mod,go.work,.go-version, and.tool-versions.@actions/cache, with examples for saving and restoring caches, cache key management, and cache path configuration. (F197aUpdated GitHub Actions workflow for Go and Webpack builds, including caching and version management.Description:
Describe your changes.
Related issue:
Add link to the related issue.
Check list:
This pull request adds a new GitHub Actions workflow in
.github/workflows/webpack.ymlto automate building and testing Node.js and Go projects across multiple environments. The workflow introduces comprehensive build matrix strategies, version management, and caching improvements for both Node.js (with Webpack) and Go, supporting a wide range of versions and configurations.Key changes:
Workflow automation and build matrix:
pushandpull_requestevents for themainbranch, automating builds for multiple Node.js versions (18.x, 20.x, 22.x) and various Go versions (including stable, oldstable, RC, and beta) across different operating systems (Ubuntu, macOS, Windows).Node.js and Webpack integration:
Go version management and advanced configuration:
go.mod,go.work,.go-version,.tool-versions),