-
Hey all, I'm using this action, and I'm configuring it as follows: filesChanged:
runs-on: small-runner
outputs:
files: ${{ steps.changed-files.outputs.all_changed_files }}
steps:
- name: Get changed files in the kong--plugins folder
id: changed-files
uses: tj-actions/changed-files@v42
with:
files: kong-plugins/**
json: true
escape_json: false
dir_names: true
dir_names_exclude_current_dir: true The output is |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @lays147 there are a couple of approaches you can take
...
- name: Get changed files in the kong-plugins folder
id: changed-files
uses: tj-actions/changed-files@v42
with:
path: kong-plugins
json: true
escape_json: false
dir_names: true
dir_names_exclude_current_dir: true
...
- name: Filter out parent directory from output
id: filter-output
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
# Use jq to filter out the 'kong-plugins' folder, assuming jq is available in your runner environment
FILTERED_OUTPUT=$(echo $ALL_CHANGED_FILES | jq 'map(select(. != "kong-plugins"))')
echo "::set-output name=filtered-files::$FILTERED_OUTPUT"
|
Beta Was this translation helpful? Give feedback.
-
Well, this post-processing appears to be too much of a problem for a thing that should be simple, I found out that I can exclude inputs in a matrix, so I used this: tests:
permissions:
contents: read
environment: staging
needs: filesChanged
strategy:
matrix:
folders: ${{ fromJson(needs.filesChanged.outputs.files) }}
exclude:
- folders: kong-plugins When using |
Beta Was this translation helpful? Give feedback.
Hi @lays147 there are a couple of approaches you can take
kong-plugins
but note the patterns would need to be changed to"**"
or can be omitted since you will detect only changed files within thekong-plugins
folder.kong-plugins
folder