This message was deleted.
# help
b
This message was deleted.
l
@proud-wolf-89343 what does your current pipeline look like? By breakdown files are you meaning
$SHOWFILE
?
p
I do believe it's the
$SHOWFILE
that isn't (rightfully) generated
Copy code
ATLANTIS_REPO_CONFIG_JSON: >                                                                                                                                                                         
        {                                                                                  
          "repos":[                                                                        
            {                                                                              
              "id": "/.*/",                                                                
              "branch": "/master/",                                                        
              "apply_requirements": [                                                      
                "approved",                                                                
                "mergeable",                                                               
                "undiverged"                                                               
              ],                                                                           
              "delete_source_branch_on_merge": true,                                       
              "workflow": "terraform-infracost",                                           
              "pre_workflow_hooks": [                                                      
                {                                                                          
                  "run": "rm -rf /tmp/$BASE_REPO_OWNER-$BASE_REPO_NAME-$PULL_NUM"          
                },                                                                         
                {                                                                          
                  "run": "mkdir -p /tmp/$BASE_REPO_OWNER-$BASE_REPO_NAME-$PULL_NUM"        
                }                                                                          
              ],                                                                           
              "post_workflow_hooks": [                                                     
                {                                                                          
                  "run": "infracost comment gitlab --repo $BASE_REPO_OWNER/$BASE_REPO_NAME --merge-request $PULL_NUM --path /tmp/$BASE_REPO_OWNER-$BASE_REPO_NAME-$PULL_NUM/'*'-infracost.json --gitlab-token $GITLAB_TOKEN --behavior new"
                },                                                                      
                {                                                                       
                  "run": "rm -rf /tmp/$BASE_REPO_OWNER-$BASE_REPO_NAME-$PULL_NUM"       
                }                                                                       
              ]                                                                         
            }                                                                           
          ],                                                                            
          "workflows": {                                                                
            "terraform-infracost": {                                                    
              "plan": {                                                                 
                "steps": [                                                              
                  {                                                                     
                    "env": {                                                               
                      "name": "INFRACOST_OUTPUT",                                          
                      "command": "echo /tmp/$BASE_REPO_OWNER-$BASE_REPO_NAME-$PULL_NUM/$WORKSPACE-${REPO_REL_DIR//\//-}-infracost.json"
                    }                                                                   
                  },                                                                    
                  "init",                                                               
                  "plan",                                                               
                  "show",                                                                  
                 {                                                                         
                   "run": "infracost breakdown --path=$SHOWFILE --format=json --log-level=info --out-file=$INFRACOST_OUTPUT --project-name=$REPO_REL_DIR"
                 }                                                                      
                ]                                                                       
              }                                                                         
            }                                                                           
          }
🙏 1
l
And how does Atlantis ignore the PR currently? My knowledge of Atlantis pipelines isn’t super great, but this looks like the infracost workflow only runs if a plan is run anyway. If the $SHOWFILE doesn’t exist for any reason though maybe we can add a step to exit the workflow early in that case
p
There is an atlantis.yaml file, which conatins a "when-changed" statement. Thanks for the tip on "Early exit". I'll take it up monday once I'm back to work
l
Great! also @proud-wolf-89343 our native GitLab App by default runs on only changed terraform files and works alongside Atlantis if that’s interesting: https://www.infracost.io/docs/integrations/gitlab_app/