Skip to content

fix: remove artifact-metadata:write from reusable workflows#142

Merged
derrix060 merged 1 commit into
mainfrom
fix/revert-breaking-permission-change
Apr 10, 2026
Merged

fix: remove artifact-metadata:write from reusable workflows#142
derrix060 merged 1 commit into
mainfrom
fix/revert-breaking-permission-change

Conversation

@derrix060

Copy link
Copy Markdown
Contributor

Summary

  • Remove artifact-metadata: write from the 4 reusable workflows (build + promote) to avoid breaking callers that don't yet grant this permission
  • Reusable workflows cannot request permissions the caller doesn't provide — GitHub fails with a validation error
  • The permission remains in the example files so callers can adopt it at their own pace

Follows up on #141.

Test plan

  • Verify existing caller workflows (e.g. angkor-platform-api) still pass without adding artifact-metadata: write

Reusable workflows cannot request permissions that callers don't grant
— GitHub fails with a validation error. Removing artifact-metadata:write
from the reusable workflows avoids breaking existing callers.

The permission remains in the example files so callers can adopt it at
their own pace.
Copilot AI review requested due to automatic review settings April 10, 2026 14:42
@derrix060 derrix060 merged commit 88588eb into main Apr 10, 2026
1 check passed
@derrix060 derrix060 deleted the fix/revert-breaking-permission-change branch April 10, 2026 14:42

Copilot AI left a comment

Copy link
Copy Markdown

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 aims to prevent reusable Docker build/promote workflows from failing validation when callers haven’t yet granted the new artifact-metadata: write permission, while keeping that permission in example workflows so adopters can opt in over time.

Changes:

  • Removed artifact-metadata: write from the reusable Docker build-and-push workflows’ permissions.
  • Removed the permissions block from the reusable Docker promote workflows (JFrog + Docker Hub).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/docker-promote-jfrog.yaml Removes workflow-level permissions for the JFrog promotion reusable workflow.
.github/workflows/docker-promote-dockerhub.yaml Removes workflow-level permissions for the Docker Hub promotion reusable workflow.
.github/workflows/docker-build-push-jfrog.yaml Drops artifact-metadata: write from the build/push reusable workflow permissions.
.github/workflows/docker-build-push-dockerhub.yaml Drops artifact-metadata: write from the build/push reusable workflow permissions.

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

@@ -40,12 +40,6 @@ on:
required: false
default: false

Copilot AI Apr 10, 2026

Copy link

Choose a reason for hiding this comment

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

The workflow-level permissions block was removed entirely. This reusable workflow uses OIDC (via jfrog/setup-jfrog-cli) and actions/attest-build-provenance, which require at least id-token: write and attestations: write (and typically contents: read). Without setting these here, callers must provide them explicitly, turning this into a breaking change and potentially causing runtime failures rather than a clear permissions validation error. Consider restoring the permissions block and only dropping artifact-metadata: write (per PR intent), or explicitly moving the required permissions to a job-level permissions stanza with the same effect.

Suggested change
permissions:
contents: read
id-token: write
attestations: write

Copilot uses AI. Check for mistakes.
@@ -33,12 +33,6 @@ on:
description: "Docker Hub password"
required: true

Copilot AI Apr 10, 2026

Copy link

Choose a reason for hiding this comment

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

The workflow-level permissions block was removed entirely. This workflow runs actions/attest-build-provenance, which needs id-token: write and attestations: write (and contents: read for checkout). If callers don’t set these permissions explicitly, the workflow will fail at runtime; this is a broader breaking change than just removing artifact-metadata: write. Consider re-adding the minimal required permissions here and only removing artifact-metadata: write.

Suggested change
permissions:
contents: read
id-token: write
attestations: write

Copilot uses AI. Check for mistakes.
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