Skip to content

Commit

Permalink
chore: Run repo-sync workflow only in source repo (#884)
Browse files Browse the repository at this point in the history
* Run repo-sync workflow only in source repo + stop workflows from being triggered by new commit in main.

* Make workflows run if it's being run in public repo, or it was triggered by pull request.

---------

Co-authored-by: Sichan Yoo <chanyoo@amazon.com>
  • Loading branch information
sichanyoo and Sichan Yoo authored Dec 17, 2024
1 parent aa57fd7 commit fec1b26
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

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
4 changes: 4 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,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 @@ -103,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 @@ -223,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 @@ -275,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
2 changes: 2 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

jobs:
ktlint:
if: github.repository == 'smithy-lang/smithy-swift' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout sources
Expand All @@ -16,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
1 change: 1 addition & 0 deletions .github/workflows/repo-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

jobs:
git-sync:
if: github.repository == 'smithy-lang/smithy-swift'
runs-on: ubuntu-latest

steps:
Expand Down

0 comments on commit fec1b26

Please sign in to comment.