Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conditional checks to prevent scheduled actions running inside forked repositories #2317

Merged
merged 5 commits into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
types: [opened]
jobs:
analyze:
if: github.event.pull_request.draft == false
if: github.event.pull_request.draft == false && github.repository == 'zenml-io/zenml'
name: Analyze
runs-on: ubuntu-latest
timeout-minutes: 360
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/nightly_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,22 @@ jobs:
python-version: '3.8'
git-ref: develop
secrets: inherit
if: github.repository == 'zenml-io/zenml'
publish-python-package:
needs: setup-and-test
uses: ./.github/workflows/publish_to_pypi_nightly.yml
secrets: inherit
if: github.repository == 'zenml-io/zenml'
wait-for-package-release:
if: github.repository == 'zenml-io/zenml'
runs-on: ubuntu-latest
needs: publish-python-package
steps:
- name: Sleep for 4 minutes
run: sleep 240
shell: bash
publish-docker-image:
if: github.repository == 'zenml-io/zenml'
needs: wait-for-package-release
uses: ./.github/workflows/publish_docker_image.yml
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr_labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
name: pr-label
jobs:
pr-labeler:
if: github.repository == 'zenml-io/zenml'
runs-on: ubuntu-latest
env:
ZENML_DEBUG: 1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish_api_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
jobs:
publish:
name: Build 🔨 and publish 📰 the api docs 📁 to gh-pages
if: github.repository == 'zenml-io/zenml'
runs-on: ubuntu-latest
env:
ZENML_DEBUG: 1
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
- name: Test migrations across versions
run: bash scripts/test-migrations-mariadb.sh
publish-python-package:
if: github.repository == 'zenml-io/zenml'
needs:
- setup-and-test
- mlstacks-compatibility-check
Expand All @@ -78,10 +79,12 @@ jobs:
run: sleep 240
shell: bash
publish-docker-image:
if: github.repository == 'zenml-io/zenml'
needs: wait-for-package-release
uses: ./.github/workflows/publish_docker_image.yml
secrets: inherit
publish-helm-chart:
if: github.repository == 'zenml-io/zenml'
needs: publish-docker-image
uses: ./.github/workflows/publish_helm_chart.yml
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/replace_api_docs_version
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
jobs:
update_docs:
runs-on: ubuntu-latest
if: github.repository == 'zenml-io/zenml'

steps:
- name: Check out branch
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concurrency:
cancel-in-progress: true
jobs:
spellcheck:
if: github.event.pull_request.draft == false
if: github.event.pull_request.draft == false && github.repository == 'zenml-io/zenml'
runs-on: ubuntu-dind-runners
steps:
- name: Checkout code
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/templates-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ jobs:
ZENML_ANALYTICS_OPT_IN: false
PYTHONIOENCODING: utf-8
OBJC_DISABLE_INITIALIZE_FORK_SAFETY: 'YES'
if: ${{ ! startsWith(github.event.head_commit.message, 'GitBook:') }}
if: ${{ ! startsWith(github.event.head_commit.message, 'GitBook:') }} && github.repository
== 'zenml-io/zenml'
defaults:
run:
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/trivy-zenml-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
jobs:
trivy-scan:
name: Trivy zenml scan & analysis
if: github.repository == 'zenml-io/zenml'
runs-on: ubuntu-20.04
steps:
- name: Checkout code
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/trivy-zenserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
jobs:
trivy-scan:
name: Trivy ZenServer scan & analysis
if: github.repository == 'zenml-io/zenml'
runs-on: ubuntu-20.04
steps:
- name: Checkout code
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart/.copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: 2023.12.18-3-g5b0d7c9
_commit: 2024.01.12
_src_path: gh:zenml-io/template-starter
email: ''
full_name: ZenML GmbH
Expand Down