Skip to content

Commit c142f2c

Browse files
committed
(build) allow to push to docker images to GitHub Package Registry for origin only
1 parent 8f64016 commit c142f2c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,25 +343,25 @@ jobs:
343343

344344
-
345345
name: Login to GitHub Container Registry
346-
if: success() && github.event_name != 'pull_request'
346+
if: success() && github.event_name != 'pull_request' && github.repository == 'GitTools/GitVersion'
347347
uses: docker/login-action@v1
348348
with:
349349
registry: ghcr.io
350350
username: ${{ github.repository_owner }}
351351
password: ${{ secrets.DOCKER_GITHUB_TOKEN }}
352352
-
353353
name: '[Docker Build/Test/Publish (amd64)] GitHub Container Registry'
354-
if: success() && github.event_name != 'pull_request'
354+
if: success() && github.event_name != 'pull_request' && github.repository == 'GitTools/GitVersion'
355355
shell: pwsh
356356
run: dotnet run/docker.dll --target=DockerPublish --arch amd64 --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} --docker_registry github
357357
-
358358
name: '[Docker Build/Test/Publish (arm64)] GitHub Container Registry'
359-
if: success() && github.event_name != 'pull_request'
359+
if: success() && github.event_name != 'pull_request' && github.repository == 'GitTools/GitVersion'
360360
shell: pwsh
361361
run: dotnet run/docker.dll --target=DockerPublish --arch arm64 --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} --docker_registry github
362362
-
363363
name: '[Docker Publish Manifest] GitHub Container Registry'
364-
if: success() && github.event_name != 'pull_request'
364+
if: success() && github.event_name != 'pull_request' && github.repository == 'GitTools/GitVersion'
365365
shell: pwsh
366366
run: dotnet run/docker.dll --target=DockerManifest --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} --docker_registry github
367367

0 commit comments

Comments
 (0)