-
-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TF lint initialization is failing. Noticed an tailing ":" at the end of the aws plugin download during tflint init #2947
Comments
@chilukurib did you override your GITHUB_TOKEN ? tflint downloads aws plugin on Github, so the "bad credentials" could be from that You can also try |
I'm currently using GitHub Enterprise and finding similar quirks, largely due to setting |
@priorax maybe try to define a Personal Access Token then force its value in environment variable GITHUB_TOKEN ? |
This issue has been automatically marked as stale because it has not had recent activity. If you think this issue should stay open, please remove the |
So we are having this issue. If we do add a personal pat for github.com wouldn't this mean it would fail to post back to the PR the results? I'm assuming it was using the GITHUB_TOKEN to post back the results of the PR |
@codezninja if you PAT has the rights to post PR comments, they will be posted :) |
Sorry I should've been more clear. I meant if we use a PAT for GitHub.com to fix the tflint init but this action is running on GitHub Enterprise it might fix that but it won't have permissions to post back to the PR |
@codezninja indeed :o |
GITHUB_TOKEN is used for tflint --init (not PAT) So you might hack by defining: It's ugly but it might work ^^ |
We'll try that and see how that works. |
@codezninja and I work together. I just tested this out and I have mixed results to share I updated our Github Actions on our GitHub Enterprise server to use - name: MegaLinter
uses: oxsecurity/megalinter@v8
id: ml
env:
VALIDATE_ALL_CODEBASE: true
PAT: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB_COM }} This fixed the issues we were having with tflint, however it seems to have broke other linters that reference things in repos on our GitHub Enterprise Server. Some Examples:
Terrascan results in several
There are others, but I think this is enough example to get the point across. |
Damn, i get it ^^ |
@nvuillam Thank You Sir |
Allow to replace an ENV var value with the value of another ENV var before calling a PRE_COMMAND (helps for tflint run from GitHub Enterprise) Fixes #2947
Allow to replace an ENV var value with the value of another ENV var before calling a PRE_COMMAND (helps for tflint run from GitHub Enterprise) Fixes #2947
@jared-bloomer you can check with beta in a few minutes :) Try with TERRAFORM_TFLINT_UNSECURED_ENV_VARIABLES:
- GITHUB_TOKEN
- PAT_GITHUB_COM Also define a secret variable PAT_GITHUB_COM with a github.com Personal Access Token :) |
I will check the next time I am at work. Thanks |
@nvuillam we are getting closer. Now we are getting host key verification errors on our GHE server.
I think we need to load in our GHE Known host. I am not entirely sure how to go about that. |
Is there a "permissions" key at the workflow level that doesn't allow to use "content: read" to allow checkout when not in GitHub.com? (If you were using PATs instead, then I would be surprised it would make a difference) |
I think it is because we have terraform trying to grab modules over ssh and that's where the host keys are coming from.
On Dec 2, 2024 at 17:24, Edouard Choinière ***@***.******@***.***>> wrote:
Is there a "permissions" key at the workflow level that doesn't allow to use "content: read" to allow checkout when not in GitHub.com?
(If you were using PATs instead, then I would be surprised it would make a difference)
—
Reply to this email directly, view it on GitHub<#2947 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFZNGBM5IQULIME4SDDMGYD2DTM2BAVCNFSM6AAAAABSDEIBZOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMJTGA4DGMZXGU>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
This seems to not he a tflint init issue anymore, please can you open another issue ? :) |
@nvuillam Issue #4343 has been created |
Describe the bug
TF lint initialization is failing. Noticed an tailing ":" at the end of the aws plugin download during tflint init which is giving not-found message when opened in browser
To Reproduce
Steps to reproduce the behavior:
exexcute linting on terraform code
Expected behavior
megalinter should initialize the tf_lint
ERROR LOG
I see an tailing colon in the url from the log
https://api.github.com/repos/terraform-linters/tflint-ruleset-aws/releases/tags/v0.23.1:
which is giving message not-foundThe text was updated successfully, but these errors were encountered: