From b2bc2130fce5268055219158c55d939088f4cb35 Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Fri, 4 Oct 2024 19:32:59 +0200 Subject: [PATCH] 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 ``` --- .github/workflows/container-build.yml | 1 + .github/workflows/docs-deploy.yml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.github/workflows/container-build.yml b/.github/workflows/container-build.yml index f1007db102..4465d2f52a 100644 --- a/.github/workflows/container-build.yml +++ b/.github/workflows/container-build.yml @@ -10,6 +10,7 @@ on: - 'Dockerfile.ci' jobs: container-build: + if: github.repository == 'conventional-changelog/commitlint' runs-on: ubuntu-latest steps: - name: checkout diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.yml index d8c37997fd..c7c7891a64 100644 --- a/.github/workflows/docs-deploy.yml +++ b/.github/workflows/docs-deploy.yml @@ -18,6 +18,7 @@ concurrency: jobs: # Build job build: + if: github.repository == 'conventional-changelog/commitlint' runs-on: ubuntu-latest steps: - name: Checkout @@ -49,6 +50,7 @@ jobs: # Deployment job deploy: + if: github.repository == 'conventional-changelog/commitlint' environment: name: docs url: ${{ steps.deployment.outputs.page_url }}