proud-wolf-89343
06/16/2023, 2:11 PMTF_ROOT
, which causes infracost to ignore all pull requests that do not change any terraform code?
Currently our pipelines are blocked, because infracost searches for breakdown files in pull requests, where they are never generated, because atlantis ignores the pull requestlittle-author-61621
$SHOWFILE
?proud-wolf-89343
06/16/2023, 2:42 PM$SHOWFILE
that isn't (rightfully) generated
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"
}
]
}
}
}
little-author-61621
proud-wolf-89343
06/16/2023, 3:08 PMlittle-author-61621