Skip to content

Commit fec1b26

Browse files
sichanyooSichan Yoo
andauthored
chore: Run repo-sync workflow only in source repo (#884)
* 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 <[email protected]>
1 parent aa57fd7 commit fec1b26

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

.github/workflows/codegen.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
jobs:
1010
codegen:
11+
if: github.repository == 'smithy-lang/smithy-swift' || github.event_name == 'pull_request'
1112
runs-on: ${{ matrix.os }}
1213
name: Java ${{ matrix.java }} ${{ matrix.os }}
1314
strategy:

.github/workflows/continuous-integration.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ env:
1111

1212
jobs:
1313
apple-ci:
14+
if: github.repository == 'smithy-lang/smithy-swift' || github.event_name == 'pull_request'
1415
runs-on: ${{ matrix.runner }}
1516
strategy:
1617
fail-fast: false
@@ -103,6 +104,7 @@ jobs:
103104
| xcbeautify
104105
105106
apple-downstream:
107+
if: github.repository == 'smithy-lang/smithy-swift' || github.event_name == 'pull_request'
106108
runs-on: ${{ matrix.runner }}
107109
strategy:
108110
fail-fast: false
@@ -223,6 +225,7 @@ jobs:
223225
| xcbeautify
224226
225227
linux-ci:
228+
if: github.repository == 'smithy-lang/smithy-swift' || github.event_name == 'pull_request'
226229
runs-on: ubuntu-latest
227230
strategy:
228231
fail-fast: false
@@ -275,6 +278,7 @@ jobs:
275278
run: swift test
276279

277280
linux-downstream:
281+
if: github.repository == 'smithy-lang/smithy-swift' || github.event_name == 'pull_request'
278282
runs-on: ubuntu-latest
279283
strategy:
280284
fail-fast: false

.github/workflows/lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
jobs:
1010
ktlint:
11+
if: github.repository == 'smithy-lang/smithy-swift' || github.event_name == 'pull_request'
1112
runs-on: ubuntu-latest
1213
steps:
1314
- name: Checkout sources
@@ -16,6 +17,7 @@ jobs:
1617
run: ./gradlew ktlint
1718

1819
swiftlint:
20+
if: github.repository == 'smithy-lang/smithy-swift' || github.event_name == 'pull_request'
1921
runs-on: ubuntu-latest
2022
container:
2123
image: ghcr.io/realm/swiftlint:0.54.0

.github/workflows/repo-sync.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77

88
jobs:
99
git-sync:
10+
if: github.repository == 'smithy-lang/smithy-swift'
1011
runs-on: ubuntu-latest
1112

1213
steps:

0 commit comments

Comments
 (0)