Skip to content

fix(ci): skip image push for forked pull requests#21

Merged
rpignolet merged 1 commit into
OKDP:mainfrom
idirze:fix/ci
Jun 5, 2026
Merged

fix(ci): skip image push for forked pull requests#21
rpignolet merged 1 commit into
OKDP:mainfrom
idirze:fix/ci

Conversation

@idirze

@idirze idirze commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Description

This PR updates the Docker CI workflow to safely handle pull requests opened from forked repositories.

Before this change, the workflow always logged in to the CI registry and always pushed the Docker image:

push: true

This works for same-repository pull requests and trusted events, but fails for forked pull requests because they do not have write access to the package registry.

This PR adds a CI push policy that detects whether the workflow is running from a forked pull request.

Behavior after this change:

same-repository PR / trusted event -> build + login + push CI image
forked PR                          -> build only, no registry login, no image push

The workflow now skips registry login and disables Docker image push for forked pull requests, while preserving the existing push behavior for trusted CI runs.

This PR also fixes the CI image tag step by removing the undefined IMAGE_TAGS variable and logging the actual generated ci_tag.

Related Issue

Fixes #

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor / chore
  • Breaking change

How to Test

  1. Open a pull request from a branch inside the same repository.

    Expected result:

    CI registry login runs
    Docker image is built
    Docker image is pushed to the CI registry
    
  2. Open a pull request from a forked repository.

    Expected result:

    CI registry login is skipped
    Docker image is built
    Docker image is not pushed
    Workflow does not fail because of registry write permissions
    
  3. Verify that the generated CI image tag is correctly printed in the workflow logs.

  4. Verify that trusted non-PR events still push the CI image as before.

Checklist

@rpignolet rpignolet merged commit 12b60f8 into OKDP:main Jun 5, 2026
@idirze idirze deleted the fix/ci branch June 5, 2026 13:14
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