Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 13, 2025

GitHub Actions workflow was failing due to invalid YAML syntax - a strategy matrix was placed inside a step definition instead of at the job level.

Changes:

  • Reverted to explicit download steps for each package artifact (6 total)
  • Retained error handling for missing packages directory and empty artifact downloads
  • Added actionlint to .gitignore

Context:
The strategy keyword in GitHub Actions must be defined at the job level, not within steps. Conditional artifact downloads based on inputs.package require either separate steps or job-level matrix with complex conditionals. Chose separate steps for clarity and maintainability.

# Invalid (previous)
- name: Download package artifact
  if: inputs.package == 'All' || inputs.package == matrix.package
  uses: actions/download-artifact@v4
  strategy:
    matrix:
      package: [...]

# Valid (current)
- name: Download NLog.Extensions.AzureBlobStorage
  if: inputs.package == 'All' || inputs.package == 'NLog.Extensions.AzureBlobStorage'
  uses: actions/download-artifact@v4

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add CI steps for NuGet publishing workflow Fix invalid matrix strategy placement in publish workflow Dec 13, 2025
Copilot AI requested a review from JDetmar December 13, 2025 06:03
@JDetmar JDetmar marked this pull request as ready for review December 13, 2025 06:04
Copilot AI review requested due to automatic review settings December 13, 2025 06:04
@JDetmar JDetmar merged commit 9e22d66 into ci-publish-workflow Dec 13, 2025
2 of 5 checks passed
@JDetmar JDetmar deleted the copilot/sub-pr-185 branch December 13, 2025 06:04
Copy link
Contributor

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 fixes a critical YAML syntax error in the publish workflow where a strategy matrix was incorrectly placed inside a step definition. GitHub Actions requires strategy to be defined at the job level, not within individual steps. The fix reverts to explicit download steps for each of the 6 package artifacts, maintaining conditional logic for selective or bulk publishing.

Key Changes:

  • Fixed invalid YAML syntax by replacing step-level matrix strategy with 6 explicit download steps
  • Each download step includes proper conditionals based on inputs.package parameter
  • Added actionlint to .gitignore for workflow linting tool

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
.gitignore Added actionlint (GitHub Actions workflow linter) to ignored files
.github/workflows/publish.yml Replaced invalid step-level matrix strategy with 6 explicit artifact download steps, each with conditional logic for selective package publishing

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

name: package-NLog.Extensions.AzureServiceBus
path: packages
github-token: ${{ github.token }}
run-id: ${{ steps.get-run-id.outputs.run_id }}
Copy link

Copilot AI Dec 13, 2025

Choose a reason for hiding this comment

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

Missing blank line before this step. All other steps in the workflow are separated by blank lines for consistency and readability.

Suggested change
run-id: ${{ steps.get-run-id.outputs.run_id }}
run-id: ${{ steps.get-run-id.outputs.run_id }}

Copilot uses AI. Check for mistakes.
JDetmar added a commit that referenced this pull request Dec 13, 2025
#185)

* Add CI steps for restoring projects and create publish workflow for NuGet

* Update .github/workflows/publish.yml

Co-authored-by: Copilot <[email protected]>

* Update .github/workflows/publish.yml

Co-authored-by: Copilot <[email protected]>

* Update .github/workflows/publish.yml

Co-authored-by: Copilot <[email protected]>

* Update .github/workflows/ci.yml

Co-authored-by: Copilot <[email protected]>

* Update .github/workflows/ci.yml

Co-authored-by: Copilot <[email protected]>

* Add error handling for missing packages in publish workflow (#186)

* Initial plan

* Add error handling for package discovery in publish workflow

Co-authored-by: JDetmar <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: JDetmar <[email protected]>

* Fix invalid matrix strategy placement in publish workflow (#187)

* Initial plan

* Fix publish.yml syntax error - move strategy matrix to proper structure

Co-authored-by: JDetmar <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: JDetmar <[email protected]>

* Add restore step for matrix projects in CI workflow

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
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.

2 participants