Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 20, 2025

The Docker workflow fails with Error: Invalid value for enable attribute: {{is_default_branch}} because the workflow uses docker/metadata-action v3.3.0, which doesn't support the {{is_default_branch}} global expression (added in v3.7.0).

Changes

  • Upgraded docker/metadata-action from v3.3.0 (commit 98669ae) to v5.9.0 (commit 318604b)
  • Restored {{is_default_branch}} syntax which is now supported in v5.9.0
  • Enabled pull request builds to test Docker builds on PRs (workflow does not push images for PRs)
  • Added multi-platform support for both AMD64 and ARM64 architectures
# Before
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
...
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}

# After  
uses: docker/metadata-action@318604b99e75e41977312d83839a89be02ca4893 # v5.9.0
...
type=raw,value=latest,enable={{is_default_branch}}
...
platforms: linux/amd64,linux/arm64

Workflow Behavior

  • On push to main or tags: Builds for both AMD64 and ARM64 platforms, pushes images to registry, and signs them
  • On pull requests: Builds for both platforms to verify Docker build works, but does NOT push or sign
  • Latest tag: Only applied when building from the main branch

Research

No breaking changes between v3.3.0 and v5.9.0 affect this workflow's configuration. The upgrade is backward compatible for our use case.

Original prompt

Getting this error in the Docker GitHub action workflow: Error: Invalid value for enable attribute: {{is_default_branch}}


💡 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 self-assigned this Nov 20, 2025
…Hub Actions expression

Co-authored-by: paulirwin <1874103+paulirwin@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix invalid value error in Docker GitHub action Fix docker/metadata-action incompatibility: replace {{is_default_branch}} with GitHub Actions expression Nov 20, 2025
Copilot AI requested a review from paulirwin November 20, 2025 19:28
@paulirwin
Copy link
Member

@copilot Please upgrade the docker/metadata-action task to v5.9.0. Please research to see if there are breaking changes. then you should be able to use is_default_branch again

…nch}} syntax

Co-authored-by: paulirwin <1874103+paulirwin@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 20, 2025

@copilot Please upgrade the docker/metadata-action task to v5.9.0. Please research to see if there are breaking changes. then you should be able to use is_default_branch again

Upgraded to docker/metadata-action v5.9.0 (commit 318604b) and restored {{is_default_branch}} syntax. No breaking changes found that affect this workflow. The upgrade was completed in commit e248e32.

Co-authored-by: paulirwin <1874103+paulirwin@users.noreply.github.com>
Copilot AI changed the title Fix docker/metadata-action incompatibility: replace {{is_default_branch}} with GitHub Actions expression Upgrade docker/metadata-action to v5.9.0, enable PR builds, and add ARM64 support Nov 20, 2025
@paulirwin paulirwin marked this pull request as ready for review November 20, 2025 19:44
@paulirwin paulirwin merged commit ba2fede into main Nov 20, 2025
4 checks passed
@paulirwin paulirwin deleted the copilot/fix-docker-action-error branch November 20, 2025 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants