mirror of
https://gh-proxy.com/https://github.com/docker/build-push-action
synced 2026-06-23 00:47:46 +08:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f5471b5386 | |||
| 7b93b2b85c | |||
| f55bd083f2 |
@@ -1,9 +1,6 @@
|
|||||||
# reusable workflow
|
# reusable workflow
|
||||||
name: .e2e-run
|
name: .e2e-run
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
@@ -117,8 +114,8 @@ jobs:
|
|||||||
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
|
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY_FQDN || inputs.registry }}
|
registry: ${{ env.REGISTRY_FQDN || inputs.registry }}
|
||||||
username: ${{ env.REGISTRY_USER || secrets.registry_username }}
|
username: ${{ env.REGISTRY_USER || secrets.registry_username || (inputs.registry == 'ghcr.io' && github.actor) || '' }}
|
||||||
password: ${{ env.REGISTRY_PASSWORD || secrets.registry_password }}
|
password: ${{ env.REGISTRY_PASSWORD || secrets.registry_password || (inputs.registry == 'ghcr.io' && secrets.GITHUB_TOKEN) || '' }}
|
||||||
scope: ${{ inputs.type == 'remote' && inputs.registry == '' && '@push' || '' }}
|
scope: ${{ inputs.type == 'remote' && inputs.registry == '' && '@push' || '' }}
|
||||||
-
|
-
|
||||||
name: Build and push
|
name: Build and push
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
uses: ./.github/workflows/.e2e-run.yml
|
uses: ./.github/workflows/.e2e-run.yml
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write # to push image to GHCR
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -38,7 +41,7 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: GitHub
|
name: GitHub
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
slug: ghcr.io/docker-ghactiontest/test
|
slug: ghcr.io/docker/build-push-action-test
|
||||||
auth: ghcr
|
auth: ghcr
|
||||||
type: remote
|
type: remote
|
||||||
-
|
-
|
||||||
@@ -100,11 +103,11 @@ jobs:
|
|||||||
registry: ${{ matrix.registry }}
|
registry: ${{ matrix.registry }}
|
||||||
slug: ${{ matrix.slug }}
|
slug: ${{ matrix.slug }}
|
||||||
secrets:
|
secrets:
|
||||||
# Pass only the two secrets needed by each matrix entry.
|
# Pass only the registry-specific secrets needed by each matrix entry.
|
||||||
|
# GHCR uses the called workflow's GITHUB_TOKEN fallback.
|
||||||
registry_username: >-
|
registry_username: >-
|
||||||
${{
|
${{
|
||||||
matrix.auth == 'dockerhub' && secrets.DOCKERHUB_USERNAME ||
|
matrix.auth == 'dockerhub' && secrets.DOCKERHUB_USERNAME ||
|
||||||
matrix.auth == 'ghcr' && secrets.GHCR_USERNAME ||
|
|
||||||
matrix.auth == 'gitlab' && secrets.GITLAB_USERNAME ||
|
matrix.auth == 'gitlab' && secrets.GITLAB_USERNAME ||
|
||||||
matrix.auth == 'aws' && secrets.AWS_ACCESS_KEY_ID ||
|
matrix.auth == 'aws' && secrets.AWS_ACCESS_KEY_ID ||
|
||||||
matrix.auth == 'gar' && secrets.GAR_USERNAME ||
|
matrix.auth == 'gar' && secrets.GAR_USERNAME ||
|
||||||
@@ -116,7 +119,6 @@ jobs:
|
|||||||
registry_password: >-
|
registry_password: >-
|
||||||
${{
|
${{
|
||||||
matrix.auth == 'dockerhub' && secrets.DOCKERHUB_TOKEN ||
|
matrix.auth == 'dockerhub' && secrets.DOCKERHUB_TOKEN ||
|
||||||
matrix.auth == 'ghcr' && secrets.GHCR_PAT ||
|
|
||||||
matrix.auth == 'gitlab' && secrets.GITLAB_TOKEN ||
|
matrix.auth == 'gitlab' && secrets.GITLAB_TOKEN ||
|
||||||
matrix.auth == 'aws' && secrets.AWS_SECRET_ACCESS_KEY ||
|
matrix.auth == 'aws' && secrets.AWS_SECRET_ACCESS_KEY ||
|
||||||
matrix.auth == 'gar' && secrets.GAR_JSON_KEY ||
|
matrix.auth == 'gar' && secrets.GAR_JSON_KEY ||
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run:
|
run:
|
||||||
uses: crazy-max/.github/.github/workflows/pr-assign-author.yml@9ba6e6f9450baf3b1237f8035c1fdc45932510bd # v1.8.0
|
uses: crazy-max/.github/.github/workflows/pr-assign-author.yml@716fd1c51a46c5d93a41d44a94b439c9ee802536 # v1.10.0
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
zizmor:
|
zizmor:
|
||||||
uses: crazy-max/.github/.github/workflows/zizmor.yml@9ba6e6f9450baf3b1237f8035c1fdc45932510bd # v1.8.0
|
uses: crazy-max/.github/.github/workflows/zizmor.yml@716fd1c51a46c5d93a41d44a94b439c9ee802536 # v1.10.0
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
security-events: write
|
security-events: write
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
rules:
|
||||||
|
# rule does not apply to reusable worfklows where permissions are defined by
|
||||||
|
# the caller workflow and not the reusable workflow itself
|
||||||
|
excessive-permissions:
|
||||||
|
ignore:
|
||||||
|
- .e2e-run.yml
|
||||||
Reference in New Issue
Block a user