Skip to content

Comparison betwwen different tags not working where as it compares with default branch  #237

Open
@maazmmd

Description

@maazmmd

Hello,

When i run this workflow against develop/ (i.e merge PR to develop/), it compares default branch rather than tags

eg: 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 with develop

Here is my workflow file. The issue is on step: - uses: dorny/paths-filter@v2.11.1

on:
  workflow_call:
    inputs:
      profile:
        description: "Environment to deploy, must be one of (dev|master|int|prod)"
        required: true
        type: string
      region:
        description: "Region to deploy, must be one of (emea|cn)"
        required: true
        type: string
      git_tag:
        description: "Git tag of the release to deploy"
        required: true
        type: string
        
jobs:
  deploy:
    runs-on: [self-hosted, linux, X64, build-node]
    steps:
      - uses: ./workflows/actions/com/github/actions/checkout/v3
        with:
          path: repo
          ref: ${{ inputs.git_tag }}
          fetch-depth: 0
      
      - name: Get previous deployed version from release.yaml
        id: getversion
        working-directory: repo
        run: |
          if [ -z ${{ inputs.tenant }} ]; then
            echo "git_previous_tag=$(cat environments/${{ inputs.profile }}/${{ inputs.region }}/release.yaml | yq e '.previousVer')"
            echo "git_previous_tag=$git_previous_tag" >> $GITHUB_OUTPUT
          else
            echo "git_previous_tag=develop" >> $GITHUB_OUTPUT
          fi 

      - uses: ./workflows/actions/com/github/dorny/paths-filter/4512585405083f25c027a35db413c2b3b9006d50
        id: changes
        with:
          base: ${{ steps.getversion.outputs.git_previous_tag }}
          working-directory: meid
          filters: |
            values: ['environments/${{ inputs.profile }}/${{ inputs.region }}/values.yaml']
            tokenstore: ['environments/${{ inputs.profile }}/${{ inputs.region }}/token-values.yaml']
            userstore: ['environments/${{ inputs.profile }}/${{ inputs.region }}/user-values.yaml']
            clients: ['environments/${{ inputs.profile }}/${{ inputs.region }}/clients.yaml', 'clients/**']

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions