Skip to content

Commit

Permalink
Make workflows run if it's being run in public repo, or it was trigge…
Browse files Browse the repository at this point in the history
…red by pull request.
  • Loading branch information
Sichan Yoo committed Dec 16, 2024
1 parent 905490d commit 7475d46
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: Codegen

on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:

jobs:
codegen:
if: github.repository == 'smithy-lang/smithy-swift' || github.event_name == 'pull_request'
runs-on: ${{ matrix.os }}
name: Java ${{ matrix.java }} ${{ matrix.os }}
strategy:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:

Expand All @@ -9,6 +11,7 @@ env:

jobs:
apple-ci:
if: github.repository == 'smithy-lang/smithy-swift' || github.event_name == 'pull_request'
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -101,6 +104,7 @@ jobs:
| xcbeautify
apple-downstream:
if: github.repository == 'smithy-lang/smithy-swift' || github.event_name == 'pull_request'
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -221,6 +225,7 @@ jobs:
| xcbeautify
linux-ci:
if: github.repository == 'smithy-lang/smithy-swift' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -273,6 +278,7 @@ jobs:
run: swift test

linux-downstream:
if: github.repository == 'smithy-lang/smithy-swift' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: Lint

on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:

jobs:
ktlint:
if: github.repository == 'smithy-lang/smithy-swift' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout sources
Expand All @@ -14,6 +17,7 @@ jobs:
run: ./gradlew ktlint

swiftlint:
if: github.repository == 'smithy-lang/smithy-swift' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
container:
image: ghcr.io/realm/swiftlint:0.54.0
Expand Down

0 comments on commit 7475d46

Please sign in to comment.