Skip to content

php-build tries to push docker image when GITHUB_TOKEN does not have push permissions #9

Closed
@vierbergenlars

Description

@vierbergenlars

I encountered this issue recently when an external contributor sent a PR to add additional PHP versions to the test matrix.

For this PR vierbergenlars/php-semver#59, the image build fails (see https://github.com/vierbergenlars/php-semver/runs/7233328378?check_suite_focus=true#step:5:136) because the external contributor obviously does not have permission to publish the docker image to my repositories' namespace.

I think it's not necessary for the built docker image to always be pushed. When the image is used in the same step as it is built, it's enough that the image is present locally, without being pushed to the repository.

Of course, this negates the build speed gained by not rebuilding the image every time, but at least builds added by an external contributor will work. The first time that the action runs on with permissions of the repository owner, images will be pushed and used for future builds (even for external contributors)

It should be relatively simple to fix this issue, by making it optional for the docker push to succeed by putting it in an if and maybe logging a warning or by adding || exit 0 to the line.

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