GitHub action to Identify the path for a Pull Request in a monorepo.
4.5K
Source: https://github.com/paha/github-action-go
GitHub Action to identify a path of changed files on monorepos, with regex and depth validation.
Example use-case is execution path for Terraform monorepo. The GitHub action fetches changed files from the GitHub PR API, validates paths to determine what directory Terraform execution needs to happen.
docker://paha/github-action-tf-pathGITHUB_REF_NAME, if fails, pr_number input is taken.tf_path: PATH for visibility.Required action inputs:
| Input name | Description | Suggested value |
|---|---|---|
| token | GitHub token | ${{ github.token }} |
Optional action inputs:
| Input name | Description | Example value | default |
|---|---|---|---|
| include | Only output paths that match the regex | myproject | None |
| exclude | Exclude paths that match the regex | mynotes | ^. |
| depth | Terrafrom project path depth | 1 | 1 |
| pr_number | GitHub PR id | ${{ github.event.number }} | $GITHUB_REF_NAME |
Note:
. is not validated.on:
pull_request:
jobs:
terraform:
name: Debug
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: TF path action
id: path
uses: docker://paha/github-action-tf-path:v0.0.2
with:
token: ${{ github.token }}
- name: my path
run: echo ${{ steps.path.outputs.tf_path }}
Content type
Image
Digest
Size
2 MB
Last updated
over 4 years ago
docker pull paha/github-action-tf-path