Skip to content

Commit

Permalink
chore: Run repo-sync workflow only in source repo (#1847)
Browse files Browse the repository at this point in the history
* Run repo-sync workflow only if it's being run in source repo + stop lint CI from running with new commits in main.

* Make workflows run on new commit to main if it's public repo, or if it's triggered by pull request regardless of public or private repo

---------

Co-authored-by: Sichan Yoo <[email protected]>
  • Loading branch information
sichanyoo and Sichan Yoo authored Dec 17, 2024
1 parent 67fe900 commit e2bccee
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/codegen-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
name: Codegen, Build, and Test

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

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

jobs:
codegen-build-test:
if: github.repository == 'awslabs/aws-sdk-swift' || github.event_name == 'pull_request'
runs-on: macos-15-xlarge
env:
DEVELOPER_DIR: /Applications/Xcode_16.1.app/Contents/Developer
Expand Down
4 changes: 4 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:
if: github.repository == 'awslabs/aws-sdk-swift' || github.event_name == 'pull_request'
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -132,6 +135,7 @@ jobs:
cd ..
linux:
if: github.repository == 'awslabs/aws-sdk-swift' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
container: swift:${{ matrix.version }}-${{ matrix.os }}
strategy:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Integration Tests

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

Expand All @@ -12,6 +14,7 @@ permissions:

jobs:
apple:
if: github.repository == 'awslabs/aws-sdk-swift' || github.event_name == 'pull_request'
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -134,6 +137,7 @@ jobs:
| xcbeautify
linux:
if: github.repository == 'awslabs/aws-sdk-swift' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
container: swift:${{ matrix.version }}-${{ matrix.os }}
strategy:
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 == 'awslabs/aws-sdk-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 == 'awslabs/aws-sdk-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/release-configuration-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ env:

jobs:
codegen-build-with-release-configuration:
if: github.repository == 'awslabs/aws-sdk-swift'
runs-on: macos-14
env:
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
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 == 'awslabs/aws-sdk-swift'
runs-on: ubuntu-latest

steps:
Expand Down

0 comments on commit e2bccee

Please sign in to comment.