fix: docker should always run, even in forks (#26801)

This commit is contained in:
Maxime Beauchemin
2024-01-25 11:33:51 -08:00
committed by GitHub
parent 424b4c2378
commit 845bcc9bea
2 changed files with 10 additions and 24 deletions

View File

@@ -8,27 +8,7 @@ on:
types: [synchronize, opened, reopened, ready_for_review]
jobs:
config:
runs-on: "ubuntu-latest"
outputs:
has-secrets: ${{ steps.check.outputs.has-secrets }}
steps:
- name: "Check for secrets"
id: check
env:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
run: |
if [[ -n "$DOCKERHUB_USER" && -n "$DOCKERHUB_TOKEN" ]]; then
echo "has-secrets=true" >> "$GITHUB_ENV"
echo "has secrets!"
else
echo "has-secrets=false" >> "$GITHUB_ENV"
echo "no secrets!"
fi
docker-build:
needs: config
if: needs.config.outputs.has-secrets == 'true'
name: docker-build
runs-on: ubuntu-latest
strategy:
@@ -63,9 +43,8 @@ jobs:
run: |
./scripts/docker_build_push.sh "" ${{ matrix.target }} ${{ matrix.platform }}
ephemeral-docker-build:
needs: config
if: needs.config.outputs.has-secrets
name: docker-build
runs-on: ubuntu-latest
steps: