Sign inSign up

paha/github-action-tf-path

By paha

•Updated over 3 years ago

GitHub action to Identify the path for a Pull Request in a monorepo.

Image
1

4.5K

paha/github-action-tf-path repository overview

Source: https://github.com/paha/github-action-go⁠

⁠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.

  • Using a container for action delivery avoids spending time fetching repo, dependencies, and compiling. Recommended use is container delivery via: docker://paha/github-action-tf-path
  • PR id is taken from GITHUB_REF_NAME, if fails, pr_number input is taken.
  • The path is persisted as a Pull Request label tf_path: PATH for visibility.

Required action inputs:

Input nameDescriptionSuggested value
tokenGitHub token${{ github.token }}

Optional action inputs:

Input nameDescriptionExample valuedefault
includeOnly output paths that match the regexmyprojectNone
excludeExclude paths that match the regexmynotes^.
depthTerrafrom project path depth11
pr_numberGitHub PR id${{ github.event.number }}$GITHUB_REF_NAME

Note:

⁠Example

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 }}

⁠References:


Tag summary

Content type

Image

Digest

Size

2 MB

Last updated

over 4 years ago

docker pull paha/github-action-tf-path