Search code examples
gitazureazure-devopsdevopssqlfluff

Filename starting with .(dot) does not appear in Azure Devops pipeline


So I have one Azure Repository Where I using SQLfluff for SQL linting.

enter image description here

As You can see, I am using a property file .sqlfluff, It is available in git. In Azure devops pipeline, I am using following command to checkout the files for validation purpose.

 - checkout: self
      displayName: 'Checkout & Build.Reason: $(Build.Reason) & Build.SourceBranchName: $(Build.SourceBranchName) & System.PullRequest.TargetBranch: $(System.PullRequest.TargetBranch)'
      persistCredentials: true
      clean: true
      fetchDepth: 0

Other files are getting successfully copied to "(Build.SourcesDirectory)" except the file .sqlfluff.

enter image description here

I have tried multiple. Every files that have name starting with (.) is getting ignored. Where as other files are working fine.

Please let me know the solution.


Solution

  • I can reproduce your issue when using tree command in ubuntu image. The tree command in Unix-like operating systems doesn’t show files or directories that start with a . by default because these are considered hidden.

    - task: Bash@3
      inputs:
        targetType: 'inline'
        script: 'tree'
        workingDirectory: '$(Build.SourcesDirectory)'
    

    enter image description here

    To show the hidden files, you can use find command or add -a to tree command as mentioned by @YSC.

    • Use find

      enter image description here

    • Use tree -a

      enter image description here