From b9b5b9994f81d42ce965945dcd7369467b43417d Mon Sep 17 00:00:00 2001 From: Sichan Yoo Date: Thu, 12 Dec 2024 15:42:38 -0800 Subject: [PATCH 1/2] Run repo-sync workflow only if it's being run in source repo + stop lint CI from running with new commits in main. --- .github/workflows/lint.yml | 2 -- .github/workflows/repo-sync.yml | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 309f5ea5a76..c783b665238 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,8 +1,6 @@ name: Lint on: - push: - branches: [ main ] pull_request: workflow_dispatch: diff --git a/.github/workflows/repo-sync.yml b/.github/workflows/repo-sync.yml index a789c21b533..768318d4a18 100644 --- a/.github/workflows/repo-sync.yml +++ b/.github/workflows/repo-sync.yml @@ -7,6 +7,7 @@ on: jobs: git-sync: + if: github.repository == 'awslabs/aws-sdk-swift' runs-on: ubuntu-latest steps: From 18d9ad4d965bec320e4521e73b8cb3226dc3677e Mon Sep 17 00:00:00 2001 From: Sichan Yoo Date: Mon, 16 Dec 2024 09:49:40 -0800 Subject: [PATCH 2/2] 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 --- .github/workflows/codegen-build-test.yml | 3 +++ .github/workflows/continuous-integration.yml | 4 ++++ .github/workflows/integration-test.yml | 4 ++++ .github/workflows/lint.yml | 4 ++++ .github/workflows/release-configuration-build.yml | 1 + 5 files changed, 16 insertions(+) diff --git a/.github/workflows/codegen-build-test.yml b/.github/workflows/codegen-build-test.yml index bb05fa9a141..b7317296a76 100644 --- a/.github/workflows/codegen-build-test.yml +++ b/.github/workflows/codegen-build-test.yml @@ -3,6 +3,8 @@ name: Codegen, Build, and Test on: + push: + branches: [ main ] workflow_dispatch: pull_request: @@ -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 diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 4404825f70d..b066f12ffc2 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -1,6 +1,8 @@ name: CI on: + push: + branches: [ main ] pull_request: workflow_dispatch: @@ -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 @@ -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: diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index bd6854f2c0a..a26d5146d53 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -1,6 +1,8 @@ name: Integration Tests on: + push: + branches: [ main ] pull_request: workflow_dispatch: @@ -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 @@ -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: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c783b665238..f5476850720 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,11 +1,14 @@ name: Lint on: + push: + branches: [ main ] pull_request: workflow_dispatch: jobs: ktlint: + if: github.repository == 'awslabs/aws-sdk-swift' || github.event_name == 'pull_request' runs-on: ubuntu-latest steps: - name: Checkout sources @@ -14,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 diff --git a/.github/workflows/release-configuration-build.yml b/.github/workflows/release-configuration-build.yml index 105042b12f7..ea07b47d250 100644 --- a/.github/workflows/release-configuration-build.yml +++ b/.github/workflows/release-configuration-build.yml @@ -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