Skip to content

Commit 7c91a25

Browse files
authored
prevent tags cleanup and artifact upload on PR branches
1 parent 9f5725d commit 7c91a25

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/ci.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ jobs:
655655
# to main branch. We are only building this for amd64 platform. (>95% pulls
656656
# are for amd64)
657657
needs: changes
658-
if: needs.changes.outputs.docs-only == 'false'
658+
if: needs.changes.outputs.docs-only == 'false' && !github.event.pull_request.head.repo.fork
659659
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
660660
env:
661661
DOCKER_CLI_EXPERIMENTAL: "enabled"
@@ -739,6 +739,7 @@ jobs:
739739
fi
740740
741741
- name: Prune old images
742+
if: github.ref == 'refs/heads/main'
742743
uses: vlaurin/action-ghcr-prune@v0.5.0
743744
with:
744745
token: ${{ secrets.GITHUB_TOKEN }}
@@ -753,6 +754,7 @@ jobs:
753754
prune-untagged: true
754755

755756
- name: Upload build artifacts
757+
if: github.ref == 'refs/heads/main'
756758
uses: actions/upload-artifact@v4
757759
with:
758760
name: coder

0 commit comments

Comments
 (0)