-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build-workspace-matrix): build dynamic work matrix based on glob…
…s and changed files (#4)
- Loading branch information
1 parent
43baf46
commit df3e16f
Showing
7 changed files
with
28,321 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# build-workspace-matrix | ||
|
||
Builds a matrix of workspaces based on glob patterns and analysis of which files have changed | ||
|
||
## Inputs | ||
|
||
### `github-token` | ||
|
||
**Required** The GitHub API token to use. | ||
|
||
### `workspaces` | ||
|
||
**Required** A newline-separated list of globs representing specific workspaces. | ||
|
||
### `global_dependencies` | ||
|
||
A newline-separated list of globs representing dependencies of each workspace. If any of the dependencies have changed then all workspaces will be returned. | ||
|
||
## Outputs | ||
|
||
### `matrix` | ||
|
||
The matrix object of the following shape: | ||
|
||
```json | ||
{ | ||
"workspace": [ | ||
"match1", | ||
"match2" | ||
] | ||
} | ||
``` | ||
|
||
## Example usage | ||
|
||
```` | ||
determine-matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.build-workspace-matrix.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@master | ||
- id: build-workspace-matrix | ||
uses: iStreamPlanet/github-actions/build-workspace-matrix@master | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
workspace_globs: | | ||
terraform/clusters/*/ | ||
dependency_globs: | | ||
terraform/modules/**/*.tf | ||
.github/workflows/terraform_diff.yml | ||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: "build-workspace-matrix" | ||
description: "Builds a matrix of workspaces based on glob patterns and analysis of which files have changed" | ||
inputs: | ||
github-token: | ||
description: The GitHub token used to create an authenticated client | ||
required: true | ||
workspaces: | ||
description: "A newline-separated list of globs representing specific workspaces" | ||
required: true | ||
global_dependencies: | ||
description: "A newline-separated list of globs representing dependencies of each workspace. If any of the dependencies have changed then all workspaces will be returned." | ||
required: false | ||
outputs: | ||
matrix: | ||
description: "The matrix object of the shape: { workspace: [] }" | ||
runs: | ||
using: "node12" | ||
main: "dist/index.js" |
Oops, something went wrong.