From 2ac0eee73265bcb2b16100651207b374dc92a966 Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Thu, 24 Apr 2025 16:48:27 +0200 Subject: [PATCH 1/2] Add a missing dependency from `swift-format` to `SwiftDiagnostics` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SwiftDiagnostics is imported in swift-format but we didn’t declare a dependency edge in the package manifest. --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 53db4bb27..38ebdbb0a 100644 --- a/Package.swift +++ b/Package.swift @@ -96,7 +96,7 @@ var targets: [Target] = [ "_SwiftFormatInstructionCounter", "SwiftFormat", .product(name: "ArgumentParser", package: "swift-argument-parser"), - ] + swiftSyntaxDependencies(["SwiftParser", "SwiftSyntax"]), + ] + swiftSyntaxDependencies(["SwiftDiagnostics", "SwiftParser", "SwiftSyntax"]), exclude: ["CMakeLists.txt"], linkerSettings: swiftformatLinkSettings ), From 809d50be1fedf82bb1204a373b6025c176521492 Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Fri, 25 Apr 2025 12:18:41 +0200 Subject: [PATCH 2/2] Trigger PR testing when PR opened by GitHub Actions is marked as ready for review PRs created by GitHub Actions don't kick off further actions (https://github.com/peter-evans/create-pull-request/blob/d57e551ebc1a16dee0b8c9ea6d24dba7627a6e35/docs/concepts-guidelines.md#triggering-further-workflow-runs). As a workaround, we mark automerge PRs that are created by GitHub actions as draft and trigger the GitHub actions by marking the PR as ready for review. But we don't want to re-trigger testing this when a normal user's PR is marked as ready for review. --- .github/workflows/pull_request.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index b09ca0d56..f1d7840ca 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -2,7 +2,7 @@ name: Pull request on: pull_request: - types: [opened, reopened, synchronize] + types: [opened, reopened, synchronize, ready_for_review] concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -12,11 +12,17 @@ jobs: tests: name: Test uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main + # PRs created by GitHub Actions don't kick off further actions (https://github.com/peter-evans/create-pull-request/blob/d57e551ebc1a16dee0b8c9ea6d24dba7627a6e35/docs/concepts-guidelines.md#triggering-further-workflow-runs). + # As a workaround, we mark automerge PRs that are created by GitHub actions as draft and trigger the GitHub actions by marking the PR as ready for review. But we don't want to re-trigger testing this when a normal user's PR is marked as ready for review. + if: (github.event.action != 'ready_for_review') || (github.event.action == 'ready_for_review' && github.event.pull_request.user.login == 'github-actions[bot]') with: linux_exclude_swift_versions: "[{\"swift_version\": \"5.8\"}]" soundness: name: Soundness uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main + # PRs created by GitHub Actions don't kick off further actions (https://github.com/peter-evans/create-pull-request/blob/d57e551ebc1a16dee0b8c9ea6d24dba7627a6e35/docs/concepts-guidelines.md#triggering-further-workflow-runs). + # As a workaround, we mark automerge PRs that are created by GitHub actions as draft and trigger the GitHub actions by marking the PR as ready for review. But we don't want to re-trigger testing this when a normal user's PR is marked as ready for review. + if: (github.event.action != 'ready_for_review') || (github.event.action == 'ready_for_review' && github.event.pull_request.user.login == 'github-actions[bot]') with: license_header_check_project_name: "Swift.org" api_breakage_check_allowlist_path: "api-breakages.txt"