Skip to content

blockopsnetwork/action-path

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

action-path

Detect named changed-path groups inside a workflow and expose the matched labels as an output.

This is useful when workflow-level paths: filters are too coarse and you want to:

  • gate jobs based on named path groups
  • build a partial matrix from changed folders
  • trigger a full rebuild when shared workflow or script paths change

Inputs

  • token: GitHub token used to query changed files. Required.
  • config-path: Path to the YAML config file in the current repository. Optional. Default: .github/changed-paths.yml

Outputs

  • changed: JSON array of matching labels

Config format

Create a config file such as .github/changed-paths.yml:

rebuild-all:
  any:
    - .github/workflows/build-docker-images.yml
    - utils/docker-images/scripts/**

rundler:
  any:
    - utils/docker-images/rundler/**

bash:
  any:
    - utils/docker-images/bash/**

Each top-level key is an output label.

Supported match modes:

  • any: match when any glob matches at least one changed file
  • all: match when every glob matches at least one changed file

Example

jobs:
  changed_paths:
    runs-on: ubuntu-latest
    outputs:
      changed: ${{ steps.changed_paths.outputs.changed }}
    steps:
      - uses: actions/checkout@v4
      - id: changed_paths
        uses: blockopsnetwork/action-path@main
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

  build:
    needs: changed_paths
    if: ${{ contains(needs.changed_paths.outputs.changed, 'rundler') }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: echo "build rundler"

Event support

Supported events:

  • pull_request
  • push

For pull_request, the action queries changed files from the PR API.

For push, the action compares before and after SHAs from the event payload.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors