devops-infra / action-format-hcl Goto Github PK
View Code? Open in Web Editor NEWGitHub Action automatically formatting all HCL and TF files
Home Page: https://christophshyper.github.io/
License: MIT License
GitHub Action automatically formatting all HCL and TF files
Home Page: https://christophshyper.github.io/
License: MIT License
I tested the Github action against HachiCorp Vault policy files, since it detects the formatting errors in the policies, then it failed because doesn't find tf and tfvars.
=> Searching for .tf and .tfvars files
error: unknown option `staged'
Wanted to see if you can include HCL Vault policies in the action or see if I can omit the step about searching .tf and .tfvars files in order to work with Vault.
The docs for write
say "Disabled if using check", but if you pass check: true
without write: false
you will end up with something like this:
Inputs:
list: false
write: true
ignore:
diff: true
check: true
recursive: true
dir:
=> Searching for .hcl files
Error, -check and -write=true cannot be used together
because the default write:true gets passed down to the script.
I would expect based on the README that it would be fine to specify check: true
without mentioning write
.
I've set up the linter with the following settings:
- name: Fail on malformatted files
uses: devops-infra/[email protected]
with:
check: true
write: false
I am getting the error attached in the screenshot.
Despite I set up 'write:false
'. Looks like it's ignoring it, then I get the error:
=> Searching for .hcl files
Error, -check and -write=true cannot be used together
I tried to integration action-format-hcl within my CI phase.
Here is he workflow I've used : https://github.com/Xat59/githubactionstest/blob/main/.github/workflows/main.yml
And here is the output where you can see the error : https://github.com/Xat59/githubactionstest/pull/1/checks?check_run_id=1420263439
As you can see, I get the unknow option 'staged'
when the workflow runs git diff
.
Maybe the ubuntu:latest runner does contain a git version that allows --staged
option on git diff
command ?
I also tried ubuntu-16.04
and ubuntu-20.04
for the runner, instead of ubuntu-latest
, but I get the same result.
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.