Skip to content

Commit

Permalink
ci: don't run container/deploy jobs in forks (#4163)
Browse files Browse the repository at this point in the history
* ci: test build in fork

* ci: don't run container/deploy jobs in forks

Otherwise they might fail with errors like:

```
Run actions/configure-pages@v5
Error: Get Pages site failed. Please verify that the repository has Pages enabled and configured to build using GitHub Actions, or consider exploring the `enablement` parameter for this action. Error: Not Found - https://docs.github.com/rest/pages/pages#get-a-apiname-pages-site
Error: HttpError: Not Found - https://docs.github.com/rest/pages/pages#get-a-apiname-pages-site
```

Or:

```
Run docker/login-action@v3
Error: Username and password required
```
  • Loading branch information
knocte authored Oct 5, 2024
1 parent f55521d commit 4bfe1ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/container-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'Dockerfile.ci'
jobs:
container-build:
if: github.repository == 'conventional-changelog/commitlint'
runs-on: ubuntu-latest
steps:
- name: checkout
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ concurrency:
jobs:
# Build job
build:
if: github.repository == 'conventional-changelog/commitlint'
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -49,6 +50,7 @@ jobs:

# Deployment job
deploy:
if: github.repository == 'conventional-changelog/commitlint'
environment:
name: docs
url: ${{ steps.deployment.outputs.page_url }}
Expand Down

0 comments on commit 4bfe1ae

Please sign in to comment.