Skip to content

Update Docker Hub Description workflow fails in forks #2

@jsoref

Description

@jsoref

https://github.com/check-spelling-sandbox/cis-gitlab-benchmark/actions/runs/20715857890/workflow

- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: logchange/cis-gitlab-benchmark

needs an if guard....

if you don't need to support forks, then if: github.repository_owner == 'logchange' is the simplest.
Otherwise, it'd be something like:

if: env.has_variables
env:
  has_variables: ${{ secrets.DOCKER_USERNAME && secrets.DOCKER_PASSWORD && '1' || '' }}

Otherwise, forks get https://github.com/check-spelling-sandbox/cis-gitlab-benchmark/actions/runs/20715857890/job/59466748506#step:3:5:

Run peter-evans/dockerhub-description@v3
Error: Required input 'username' is missing.

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