Repository navigation
Replies: 3 comments 1 reply
|
Atlantis doesn't currently have a native mechanism to ignore commits by author or commit message pattern. There's no 1. 2. Pre-workflow hook that does the formatting and fails if changes were made — You alluded to this already. A pre-workflow hook can run 3. Webhook-level filtering — If your VCS platform supports it (e.g., a reverse proxy in front of Atlantis), you could drop push events from a specific bot user before they reach Atlantis. This is infrastructure-heavy but avoids any Atlantis-side changes. Of these, option 2 (pre-workflow hook) is probably the cleanest fit for your setup since you're already running There's no existing issue or feature request tracking commit-author or commit-message filtering, so if you'd like to see that as a first-class feature, opening one would be reasonable. To reply, just mention @dosu. Docs are dead. Just use Dosu. |
|
Okay, if the pre-workflow hook is indeed "the most common pattern people use today", then maybe it's worth a try. But when I start looking into implementing that, I'm immediately confronted with the reason that I did it as a post-workflow hook instead. I rely on Atlantis to determine which projects need to be checked, and run our checkers and linters for each of those projects as part of their respective Atlantis plan steps. This means the results aren't available to commit until the post-workflow hooks run. In theory, I could do this in a pre-workflow hook by just running all of our checks on every project in our repo, which feels wasteful. Or I could check only the specific files that were changed. For It would be cool if this were something that Atlantis supported without hacks, and all I think it would take is a way to suppress autoplanning specific commits. |
|
I could try the GitHub API approach. I wonder if a project maintainer could indicate whether they would consider accepting a contribution to add a check in the spot suggested by the AI for a configurable string in the PR description? |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
We have automation that commits fixes from
terraform fmtand some other tools to pull requests made by developers. In this case, the formatting and committing is actually done by Atlantis hooks. This means that when a developer pushes a misformatted commit, Atlantis autoplan is triggered, fixes the formatting locally, runs a plan, and then pushes a commit with the formatting fixes — at which point Atlantis sees its own new commit and autoplans that too, which is useless and kind of confusing and inconvenient to the developer.I see a few potential options, most of which are not currently possible:
I’ve scoured the docs and GitHub issues for a solution to this but I haven’t been able to find anything1, and I’m wondering what I’m missing. We can’t be the only team that makes automated code fixes.
Footnotes
This feels vaguely related to https://github.com/runatlantis/atlantis/discussions/2690, but I don't think the same limitation applies here. ↩
All reactions