Skip to content

Commit 3280684

Browse files
committed
Add PR Dependency check workflow
1 parent 61db691 commit 3280684

3 files changed

Lines changed: 57 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Check for Dependencies in PR
2+
3+
on:
4+
workflow_call:
5+
pull_request_target:
6+
types: [opened, edited, reopened, labeled, unlabeled, synchronize]
7+
8+
permissions:
9+
issues: read
10+
pull-requests: read
11+
12+
jobs:
13+
check_dependencies:
14+
runs-on: ubuntu-latest
15+
name: "Check PR Dependencies"
16+
steps:
17+
- uses: gregsdennis/dependencies-action@1.4.0
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pull_request.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
types: [opened, reopened, synchronize]
99

1010
jobs:
11+
pr_dependency_check:
12+
name: PR Dependency Check
13+
uses: ./.github/workflows/check_pr_dependency.yml
14+
1115
tests_with_docker_embedded_swift:
1216
name: Test Embedded Swift SDKs
1317
uses: ./.github/workflows/swift_package_test.yml

docs/pr-dependency-workflow.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# PR Dependency Workflow Documentation
2+
3+
## Overview
4+
5+
The [`check_pr_dependency.yml`](.github/workflows/check_pr_dependency.yml) workflow uses [a third party GitHub action](https://github.com/marketplace/actions/pr-dependency-check) to enforce PR dependencies.
6+
7+
At the time of writing, the GitHub action supported the following styles, for both issues and PRs.:
8+
9+
- Quick Link: `#5`
10+
- Partial Link: `gregsdennis/dependencies-action#5`
11+
- Partial URL: `gregsdennis/dependencies-action/pull/5`
12+
- Full URL: `https://github.com/gregsdennis/dependencies-action/pull/5`
13+
- Markdown: `[markdown link](https://github.com/gregsdennis/dependencies-action/pull/5)`
14+
15+
## Usage
16+
17+
Add the following to a `.yaml` file in your `.github/workflows` directory:
18+
19+
```
20+
name: Check for Dependencies in PR
21+
22+
on:
23+
workflow_call:
24+
pull_request_target:
25+
types: [opened, edited, reopened, labeled, unlabeled, synchronize]
26+
27+
permissions:
28+
issues: read
29+
pull-requests: read
30+
31+
jobs:
32+
check_dependencies:
33+
uses: swiftlang/github-workflows/.github/workflows/check_pr_dependency.yml@<to-be-updated>
34+
```

0 commit comments

Comments
 (0)