Open maazmmd opened 2 months ago
@maazmmd did you manage to figure it out?
I figured it out.
If you define both ref
and base
it will compare them.
@maazmmd did you manage to figure it out?
Yes I was able to figure out but not using dorny/paths-filter
for comparison with tags
- name: Detect changes in feature branches
uses: ./workflows/actions/com/github/dorny/paths-filter/4512585405083f25c027a35db413c2b3b9006d50
id: changes
if: github.ref_type == 'branch'
with:
base: master
working-directory: repo
filters: |
docs: ['docs/**']
src: ['src/**']
- name: Detect tag changes for [DEPLOYMENTS]
id: tag-changes
if: github.ref_type == 'tag'
working-directory: repo
run: |
set -o xtrace
declare -A paths=(
[docs]='docs/**'
[src]='src/**')
# Get previous tag from a step (Not added here)
git_previous_tag=${{ steps.getversion.outputs.git_previous_tag }}
for key in "${!paths[@]}"; do
changed_files=$(git diff --name-only "${{ github.ref_name }}" "$git_previous_tag" -- ${paths[$key]})
if [ -z "$changed_files" ]; then
echo "$key=false" >> $GITHUB_OUTPUT
else
echo "$key=true" >> $GITHUB_OUTPUT
echo "Changes detected in $key: $changed_files"
fi
done
I figured it out. If you define both
ref
andbase
it will compare them.
Not working, also tried with working-directory
Hello,
When i run this workflow against
develop/ (i.e merge PR to develop/)
, it compares default branch rather than tagseg:
Changes will be detected between default branch and feature branch
This shows incorrect behaviour. It compare between 2 tags
eg:
Change detection refs/remotes/origin/release/1.10.0...refs/remotes/origin/release/1.10.1
It should be compared between the
tags
and not withdevelop
Here is my workflow file. The issue is on
step: - uses: dorny/paths-filter@v2.11.1