Liquibase deploy same changelogfile twice when running as CICD using docker image

Hi All,

I am doing POC on Devops setup using liquibase docker image. I am using latest image.
My master changelog has below path in my github repo.

and deploy folder contain all my actual changelog file.

Now when I am trying same from local it works but same is failing when running from github action using liquibase docker image
my yml file contain below code.

Controls when the action will run.

on:
push:
branches:
- main
paths:
- ‘dbscripts/deploy/**’

A workflow run is made up of one or more jobs that can run sequentially or in parallel

jobs:
LBJobDockerCLI:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

  • name: Run ‘Liquibase update’ in a Docker Container
    uses: docker://liquibase/liquibase:latest
    with:
    args: --url=${{ secrets.SF_URL }} --changeLogFile=./dbscripts/masterChangelog.xml --username=${{ secrets.SF_USERNAME }} --password=${{ secrets.SF_PASSWORD }} --driver=${{ secrets.SF_DRIVER }} --defaultSchemaName=${{ secrets.SF_SCHEMA }} --logLevel=debug update

Now, when I put 1 changeset for creating a table. It creates table but then my job get failed complaining table already exist. What should I do to stop liquibase to deploy same changelog file twice ? Any help?
When I modified my create table SQL as create or replace. I got deployment green, but then i see 2 entries in changelogfile with slight difference in path.

Hi @rajivgupta780184
Can you please try to remove the ./ before the changelog file path name and see if the problem goes away?
For example:
–changeLogFile=dbscripts/masterChangelog.xml

I did that all. It’s not working.

To be clear, you will need to remove any “./” where files are referenced.
So if your masterChangeLog.xml contains any “./” remove those as well.
From this:
< includeAll path="./sql_folder" relativeToChangelogFile=“true”/ >
To this:
< includeAll path=“sql_folder” relativeToChangelogFile=“true”/ >

Thanks szandany :slight_smile: . It solved my problem.

Awesome, @rajivgupta780184 !