Skip to content

Add a boolean output to indicate if the image was pushed #446

Open

Description

Please add an output that indicates whether or not the image was successfully pushed.
This can be useful in cases where the push may be filtered out, and rather than repeating the same filter on a subsequent step it would be simpler to condition it based on the output from this action. For example:

- id: build
  name: Pre-build dev container image
  uses: devcontainers/ci@v0.3
  with:
    imageName: someRepo/someImage
    imageTag: someTag
    push: filter
    refFilterForPush: |
      refs/heads/main

- id: get-digest
  name: Get image Digest
  run: |
    digest=$(docker inspect --format={{.Id}} someRepo/someImage:someTag
    echo "Image Digest: $digest"
    echo "digest=${digest}" >> $GITHUB_OUTPUT

- id: attest
  name: Attest
  uses: actions/attest-build-provenance@v3
  with:
    subject-name:  someRepo/someImage
    subject-digest: ${{ steps.get-digest.outputs.digest }}
    push-to-registry: ${{ steps.build.outputs.wasPushed }}

Activity

  1. sinbumu commented on Nov 19, 2026

    @sinbumu

    I checked the current action: registry pushes happen in the job’s post step, so a wasPushed output there would arrive too late for the attestation step in the example.

    Would you consider an opt-in mode that publishes before the build step returns, while leaving the default job-end push unchanged? In that mode, wasPushed would be true only after all requested pushes succeed and false if the filters skip publishing. Push failures would still fail the step. The attestation example should use the published manifest digest rather than docker inspect .Id.

    Is that direction worth a PR? Should the first version cover both GitHub Actions and Azure DevOps, or start with GitHub Actions?

  2. Clockwork-Muse commented on Nov 19, 2026

    @Clockwork-Muse
    Author

    Would you consider an opt-in mode that publishes before the build step returns

    This is how I thought it worked for a long while, actually, so I got really confused when tried to extract the digest (for attestation reasons) and it kept coming up empty.

    Frankly, doing it as a post step makes it impossible to do anything with the pushed image in the same job, because post doesn't happen until the job ends (not the action).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions