Skip to content

ci: Don't run internal steps if forked #1048

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

Merged
merged 1 commit into from
Apr 16, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 8 additions & 2 deletions .github/workflows/chromatic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@
# SEE: https://www.chromatic.com/docs/ci
name: chromatic

# Chromatic works best with push events, not pull_request or other event types.
on: push
on:
push:
branches:
- main
tags:
- "*"

pull_request:

jobs:
deploy:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/coder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ jobs:
-timeout=3m -count=$GOCOUNT -short -failfast

- name: Upload DataDog Trace
if: (success() || failure()) && github.actor != 'dependabot[bot]' && github.repository_owner == 'coder'
if: always() && github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork
env:
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
DD_DATABASE: fake
Expand All @@ -193,7 +193,7 @@ jobs:
run: go run scripts/datadog-cireport/main.go gotests.xml

- uses: codecov/codecov-action@v3
if: github.actor != 'dependabot[bot]' && github.repository_owner == 'coder'
if: github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./gotests.coverage
Expand Down Expand Up @@ -271,15 +271,15 @@ jobs:
-count=1 -parallel=2 -race -failfast

- name: Upload DataDog Trace
if: (success() || failure()) && github.actor != 'dependabot[bot]' && github.repository_owner == 'coder'
if: always() && github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork
env:
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
DD_DATABASE: postgresql
GIT_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: go run scripts/datadog-cireport/main.go gotests.xml

- uses: codecov/codecov-action@v3
if: github.actor != 'dependabot[bot]' && github.repository_owner == 'coder'
if: github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./gotests.coverage
Expand All @@ -290,7 +290,7 @@ jobs:
name: "deploy"
runs-on: ubuntu-latest
timeout-minutes: 20
if: github.ref == 'refs/heads/main' && github.repository_owner == 'coder'
if: github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork
permissions:
contents: read
id-token: write
Expand Down Expand Up @@ -396,15 +396,15 @@ jobs:
working-directory: site

- uses: codecov/codecov-action@v3
if: github.actor != 'dependabot[bot]' && github.repository_owner == 'coder'
if: github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./site/coverage/lcov.info
flags: unittest-js
fail_ci_if_error: true

- name: Upload DataDog Trace
if: (success() || failure()) && github.actor != 'dependabot[bot]' && github.repository_owner == 'coder'
if: always() && github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork
env:
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
DD_CATEGORY: unit
Expand Down Expand Up @@ -485,7 +485,7 @@ jobs:
working-directory: site

- name: Upload DataDog Trace
if: (success() || failure()) && github.actor != 'dependabot[bot]' && runner.os == 'Linux' && github.repository_owner == 'coder'
if: always() && github.actor != 'dependabot[bot]' && runner.os == 'Linux' && !github.event.pull_request.head.repo.fork
env:
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
DD_CATEGORY: e2e
Expand Down