From 71643ce7ecaf74451a0c6d0dc064e8334e6f8432 Mon Sep 17 00:00:00 2001 From: Bassam Khouri Date: Wed, 28 Jan 2026 16:42:50 +0000 Subject: [PATCH 1/2] Add PR Dependency check workflow --- .../workflows/github_actions_dependencies.yml | 17 ++++++++++ .github/workflows/pull_request_2.yml | 14 ++++++++ docs/pr-dependency-workflow.md | 33 +++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 .github/workflows/github_actions_dependencies.yml create mode 100644 .github/workflows/pull_request_2.yml create mode 100644 docs/pr-dependency-workflow.md diff --git a/.github/workflows/github_actions_dependencies.yml b/.github/workflows/github_actions_dependencies.yml new file mode 100644 index 00000000..93972ffb --- /dev/null +++ b/.github/workflows/github_actions_dependencies.yml @@ -0,0 +1,17 @@ +name: Check for Dependencies in PR + +on: + workflow_call: + +permissions: + issues: read + pull-requests: read + +jobs: + check_dependencies: + runs-on: ubuntu-latest + name: "Check GitHub Actions Dependencies" + steps: + - uses: gregsdennis/dependencies-action@1.4.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pull_request_2.yml b/.github/workflows/pull_request_2.yml new file mode 100644 index 00000000..87196f53 --- /dev/null +++ b/.github/workflows/pull_request_2.yml @@ -0,0 +1,14 @@ +name: Check for Dependencies in PR + +on: + pull_request_target: + types: [opened, edited, reopened, labeled, unlabeled, synchronize] + +permissions: + issues: read + pull-requests: read + +jobs: + github_actiion_pr_dependency_check: + name: GitHub Action Dependency Check + uses: ./.github/workflows/github_actions_dependencies.yml diff --git a/docs/pr-dependency-workflow.md b/docs/pr-dependency-workflow.md new file mode 100644 index 00000000..3e0eb07c --- /dev/null +++ b/docs/pr-dependency-workflow.md @@ -0,0 +1,33 @@ +# PR Dependency Workflow Documentation + +## Overview + +The [`github_actions_dependencies.yml`](.github/workflows/github_actions_dependencies.yml) workflow uses [a third party GitHub action](https://github.com/marketplace/actions/pr-dependency-check) to enforce PR dependencies. + +At the time of writing, the GitHub action supported the following styles, for both issues and PRs.: + +- Quick Link: `#5` +- Partial Link: `gregsdennis/dependencies-action#5` +- Partial URL: `gregsdennis/dependencies-action/pull/5` +- Full URL: `https://github.com/gregsdennis/dependencies-action/pull/5` +- Markdown: `[markdown link](https://github.com/gregsdennis/dependencies-action/pull/5)` + +## Usage + +Add the following to a `.yaml` file in your `.github/workflows` directory: + +``` +name: Check for GitHub Actions Dependencies in PR + +on: + pull_request_target: + types: [opened, edited, reopened, labeled, unlabeled, synchronize] + +permissions: + issues: read + pull-requests: read + +jobs: + check_dependencies: + uses: swiftlang/github-workflows/.github/workflows/github_actions_dependencies.yml.yml@ +``` From b88cd0679e73d58db15fd3ae03c347661447faf7 Mon Sep 17 00:00:00 2001 From: Bassam Khouri Date: Tue, 10 Mar 2026 11:29:36 -0400 Subject: [PATCH 2/2] Merge the two pull_request.yaml into a single file --- .github/workflows/pull_request.yml | 14 +++++++++++++- .github/workflows/pull_request_2.yml | 14 -------------- 2 files changed, 13 insertions(+), 15 deletions(-) delete mode 100644 .github/workflows/pull_request_2.yml diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 12334c05..2c92fab2 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -2,15 +2,22 @@ name: Pull request permissions: contents: read + issues: read + pull-requests: read on: pull_request: - types: [opened, reopened, synchronize] + types: [opened, edited, reopened, labeled, unlabeled, synchronize] jobs: + github_actiion_pr_dependency_check: + name: GitHub Action Dependency Check + uses: ./.github/workflows/github_actions_dependencies.yml + tests_with_docker_embedded_swift: name: Test Embedded Swift SDKs uses: ./.github/workflows/swift_package_test.yml + if: ${{ github.event_name == 'opened' || github.event_name == 'reopened' || github.event_name == 'synchronize' }} with: # Wasm enable_linux_checks: false @@ -23,6 +30,7 @@ jobs: tests_with_docker: name: Test with Docker uses: ./.github/workflows/swift_package_test.yml + if: ${{ github.event_name == 'opened' || github.event_name == 'reopened' || github.event_name == 'synchronize' }} with: # Linux linux_os_versions: '["jammy", "rhel-ubi9", "amazonlinux2"]' @@ -46,6 +54,7 @@ jobs: tests_without_docker: name: Test without Docker uses: ./.github/workflows/swift_package_test.yml + if: ${{ github.event_name == 'opened' || github.event_name == 'reopened' || github.event_name == 'synchronize' }} with: # Skip Linux which doesn't currently support docker-less workflow enable_linux_checks: false @@ -65,6 +74,7 @@ jobs: tests_macos: name: Test uses: ./.github/workflows/swift_package_test.yml + if: ${{ github.event_name == 'opened' || github.event_name == 'reopened' || github.event_name == 'synchronize' }} with: enable_linux_checks: false enable_windows_checks: false @@ -77,6 +87,7 @@ jobs: build_tests_ios: name: Build iOS Tests uses: ./.github/workflows/swift_package_test.yml + if: ${{ github.event_name == 'opened' || github.event_name == 'reopened' || github.event_name == 'synchronize' }} with: enable_linux_checks: false enable_windows_checks: false @@ -89,6 +100,7 @@ jobs: soundness: name: Soundness uses: ./.github/workflows/soundness.yml + if: ${{ github.event_name == 'opened' || github.event_name == 'reopened' || github.event_name == 'synchronize' }} with: api_breakage_check_enabled: false license_header_check_project_name: "Swift.org" diff --git a/.github/workflows/pull_request_2.yml b/.github/workflows/pull_request_2.yml deleted file mode 100644 index 87196f53..00000000 --- a/.github/workflows/pull_request_2.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Check for Dependencies in PR - -on: - pull_request_target: - types: [opened, edited, reopened, labeled, unlabeled, synchronize] - -permissions: - issues: read - pull-requests: read - -jobs: - github_actiion_pr_dependency_check: - name: GitHub Action Dependency Check - uses: ./.github/workflows/github_actions_dependencies.yml