Skip to content

Commit

Permalink
CI: Avoid logging into registry for dependabot PRs
Browse files Browse the repository at this point in the history
Fixes the following error:

    ##[group]Run redhat-actions/podman-login@v1
    with:
      registry: ghcr.io/dependabot[bot]
      username: dependabot[bot]
      password: ***
      logout: true
    env:
      IMAGE_NAME: greenwave
      REGISTRY: quay.io/factory2
      GH_REGISTRY: ghcr.io/dependabot[bot]
    ##[endgroup]
    ##[group]/usr/bin/podman version
    [command]/usr/bin/podman version
    Version:      3.4.2
    API Version:  3.4.2
    Go Version:   go1.16.6
    Built:        Thu Jan  1 00:00:00 1970
    OS/Arch:      linux/amd64
    ##[endgroup]
    [command]/usr/bin/podman login ghcr.io/dependabot[bot] -u dependabot[bot] -p ***
    Error: parse reference from "ghcr.io/dependabot[bot]": invalid reference format
    ##[error]Error: podman exited with code 125
    Error: parse reference from "ghcr.io/dependabot[bot]": invalid reference format
  • Loading branch information
hluk committed May 3, 2022
1 parent 0b55d99 commit d31a001
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/gating.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
containerfiles: Dockerfile

- name: Log in to the image registry
if: github.event_name == 'push'
if: github.event_name == 'push' && github.actor != 'dependabot[bot]'
uses: redhat-actions/podman-login@v1
with:
registry: ${{ secrets.REGISTRY_USER && env.REGISTRY || env.GH_REGISTRY }}
Expand Down

0 comments on commit d31a001

Please sign in to comment.