Skip to content

Support two new filters, only and foldersOnlyAfterFilter#134

Open
cmaster11 wants to merge 1 commit intoStockopedia:mainfrom
cmaster11:only-folders-after-filter
Open

Support two new filters, only and foldersOnlyAfterFilter#134
cmaster11 wants to merge 1 commit intoStockopedia:mainfrom
cmaster11:only-folders-after-filter

Conversation

@cmaster11
Copy link

The new filters are:

  • only: the opposite of ignore
  • foldersOnlyAfterFilter: get the list of changed folders only after having applied the include/only filters

Copying from the readme, the example is:

Example: multi-project repo

One possible usage of this action is when you have a repository containing multiple subprojects and you want
to build each folder only when a file in that folder changes, let's say a VERSION file.

.github/
proj1/
  main.js
  VERSION
proj2/
  main.js
  VERSION
proj3/
  main.js
  VERSION
readme.md

Given an example action defined like

- uses: Stockopedia/action-get-changed-files@v1
  id: get_changed
  with:
    github-token: ${{ secrets.GITHUB_TOKEN }}
    # Only find folders containing a VERSION file that has changed
    only: "*/VERSION"
    # Get the changed folders names, but only after having applied the `only` filter
    foldersOnlyAfterFilter: true 
    format: csv
- name: Echo changed files
  run: echo ${{ steps.get_changed.outputs.changed }}

And you change the VERSION file in the proj1 and proj2 folders, the result of echo ${{ steps.get_changed.outputs.changed }} above would be

proj1, proj2

* `only`: the opposite of `ignore`
* `foldersOnlyAfterFilter`: get the list of changed folders only after having applied the include/only filters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant