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
Template file not found due to use of quotes around multiple template file paths #187
Comments
If I'm doing my research correctly, it looks like arrays aren't supported. But json string arrays are. Example. But that will definitely complicate things. 🤔 |
Decided to go the config file route name: Pull Request
on:
pull_request:
jobs:
Lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Cloudformation template linting
uses: shogo82148/actions-cfn-lint@v1
with:
github_token: ${{ secrets. REDACTED_TOKEN_KEY }}
args: --config-file .cfnlintrc
Error I'm seeing when the workflow runs is Run shogo82148/actions-cfn-lint@v1
with:
github_token: ***
args: --config-file .cfnlintrc
level: error
tool_name: cfn-lint
reporter: github-pr-check
filter_mode: added
fail_on_error: false
.....
2021-02-20 19:42:55,719 - cfnlint.decode - ERROR - Template file not found: None
reviewdog: failed to run 'git rev-parse --show-prefix': exit status 128 Running the CLI locally with the following works cfn-lint --config-file .cfnlintrc Any ideas? Thank you. |
Thank you for your repot.
It works in Lines 43 to 46 in 790081d
but unfortunately, it doesn't work in
This workflow will execute the following command.
hmm... 🤔 |
I just published #188 as v1.6.15-beta1.
Can you try it please? |
Still not working for me My github action: name: Pull Request
on:
pull_request:
jobs:
Lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Cloudformation template linting
uses: shogo82148/actions-cfn-lint@1a52aa373ac920e927fafe2ddf0504ad6d167662
with:
github_token: ${{ secrets.REDACTED_TOKEN_KEY}}
cfn_lint_args: --config-file .cfnlintrc My templates:
- "**/*.yaml"
- "*.json"
Result: Run shogo82148/actions-cfn-lint@1a52aa373ac920e927fafe2ddf0504ad6d167662
with:
github_token: ***
cfn_lint_args: --config-file .cfnlintrc
level: error
tool_name: cfn-lint
reporter: github-pr-check
filter_mode: added
fail_on_error: false
.....
2021-02-21 18:02:51,047 - cfnlint.decode - ERROR - Template file not found: **/*.json
2021-02-21 18:02:51,048 - cfnlint.decode - ERROR - Template file not found: **/*.yaml
2021-02-21 18:02:51,048 - cfnlint.decode - ERROR - Template file not found: **/*.yml
reviewdog: failed to run 'git rev-parse --show-prefix': exit status 128 I even tried Note: I learned we can't access/pull patch or beta versions. Have to reference SHA directly, hence the Thank you very much for working with me on this. Cheers. |
@shogo82148 I see why. You didn't include you |
oops, I fixed it and released it as v1.6.15-beta2 |
So it seems when I used the SHA it was still pulling 1.6.14 image. But when I use Current runner version: '2.277.1'
Operating System
Virtual Environment
GITHUB_TOKEN Permissions
Prepare workflow directory
Prepare all required actions
Getting action download info
Failed to resolve action download info. Error: Unable to resolve action `shogo82148/actions-cfn-lint@1.6.15-beta2`, unable to find version `1.6.15-beta2`
Retrying in 17.048 seconds
Failed to resolve action download info. Error: Unable to resolve action `shogo82148/actions-cfn-lint@1.6.15-beta2`, unable to find version `1.6.15-beta2`
Retrying in 12.646 seconds
Error: Unable to resolve action `shogo82148/actions-cfn-lint@1.6.15-beta2`, unable to find version `1.6.15-beta2` I see you have the tag and release on your github repository and I see the docker image available on docker hub here. Github caching issue maybe? When I changed the uses: docker://shogo82148/actions-cfn-lint:1.6.15-beta2 it finally pulled from docker hub. but I got an error about reviewdog input. Run docker://shogo82148/actions-cfn-lint:1.6.15-beta2
with:
github_token: ***
cfn_lint_args: --config-file .cfnlintrc
...
2021-02-22 02:55:01,812 - cfnlint.decode - ERROR - Template file not found: None
invalid boolean value "" for -fail-on-error: parse error
Usage: reviewdog [flags] I did notice the with block previously used the defaults like so Run shogo82148/actions-cfn-lint@1a52aa373ac920e927fafe2ddf0504ad6d167662
with:
github_token: ***
cfn_lint_args: --config-file $GITHUB_WORKSPACE/.cfnlintrc
level: error
tool_name: cfn-lint
reporter: github-pr-check
filter_mode: added
fail_on_error: false but this run with docker hub only had the items I used in my github action Run docker://shogo82148/actions-cfn-lint:1.6.15-beta2
with:
github_token: ***
cfn_lint_args: --config-file .cfnlintrc Don't know what that is about yet. Looks like the defaults aren't being set. I can set them in my github action for now as a workaround. Any ideas? Thank you again for working through this with me. Cheers. |
I'm going to assume it is because if the env variables aren't set by Github Actions they can't be used in I don't know default boolean in bash (maybe 1 or 0) but the notation I've used in the past is |
Tried the normal (non docker hub) notation again to no avail. uses: shogo82148/actions-cfn-lint@1.6.15-beta2 I don't know why this isn't working Current runner version: '2.277.1'
Operating System
Virtual Environment
GITHUB_TOKEN Permissions
Prepare workflow directory
Prepare all required actions
Getting action download info
Failed to resolve action download info. Error: Unable to resolve action `shogo82148/actions-cfn-lint@1.6.15-beta2`, unable to find version `1.6.15-beta2`
Retrying in 10.469 seconds
Failed to resolve action download info. Error: Unable to resolve action `shogo82148/actions-cfn-lint@1.6.15-beta2`, unable to find version `1.6.15-beta2`
Retrying in 12.038 seconds
Error: Unable to resolve action `shogo82148/actions-cfn-lint@1.6.15-beta2`, unable to find version `1.6.15-beta2` |
When I changed the uses statement in my github action to this uses: shogo82148/actions-cfn-lint@main It pulls the old 1.6.14 docker hub image. Pull down action image 'shogo82148/actions-cfn-lint:1.6.14' is that because of this? Based on these docs I thought using |
SMH (shaking my head) I just realized why my previous attempts were failing. I was missing the After updating to uses: shogo82148/actions-cfn-lint@v1.6.15-beta2 It is still trying to pull the |
please try it uses: shogo82148/actions-cfn-lint@v1.6.15-beta3 |
Still erroring Run shogo82148/actions-cfn-lint@v1.6.15-beta3
with:
github_token: ***
cfn_lint_args: --config-file .cfnlintrc
level: error
tool_name: cfn-lint
reporter: github-pr-check
filter_mode: added
fail_on_error: false
...
2021-02-22 07:45:42,176 - cfnlint.decode - ERROR - Template file not found: None
reviewdog: failed to run 'git rev-parse --show-prefix': exit status 128 |
Can I have the whole of your workflow YAML file and logs, please? |
name: Pull Request
on:
pull_request:
jobs:
Lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Cloudformation template linting
uses: shogo82148/actions-cfn-lint@v1.6.15-beta3
with:
github_token: ${{ secrets.REDACTED_TOKEN_KEY }}
cfn_lint_args: --config-file .cfnlintrc
LOGS
2021-02-22T07:45:19.9007788Z ##[section]Starting: Request a runner to run this job
2021-02-22T07:45:20.2216765Z Can't find any online and idle self-hosted runner in current repository that matches the required labels: 'ubuntu-latest'
2021-02-22T07:45:20.2216860Z Can't find any online and idle self-hosted runner in current repository's account/organization that matches the required labels: 'ubuntu-latest'
2021-02-22T07:45:20.2217320Z Found online and idle hosted runner in current repository's account/organization that matches the required labels: 'ubuntu-latest'
2021-02-22T07:45:20.3785673Z ##[section]Finishing: Request a runner to run this job
2021-02-22T07:45:28.2244386Z Current runner version: '2.277.1'
2021-02-22T07:45:28.2280718Z ##[group]Operating System
2021-02-22T07:45:28.2281559Z Ubuntu
2021-02-22T07:45:28.2281997Z 18.04.5
2021-02-22T07:45:28.2282406Z LTS
2021-02-22T07:45:28.2409741Z ##[endgroup]
2021-02-22T07:45:28.2410236Z ##[group]Virtual Environment
2021-02-22T07:45:28.2410809Z Environment: ubuntu-18.04
2021-02-22T07:45:28.2411253Z Version: 20210211.1
2021-02-22T07:45:28.2412112Z Included Software: https://github.com/actions/virtual-environments/blob/ubuntu18/20210211.1/images/linux/Ubuntu1804-README.md
2021-02-22T07:45:28.2413102Z ##[endgroup]
2021-02-22T07:45:28.2414977Z ##[group]GITHUB_TOKEN Permissions
2021-02-22T07:45:28.2416414Z Actions: write
2021-02-22T07:45:28.2416844Z Checks: write
2021-02-22T07:45:28.2417242Z Contents: write
2021-02-22T07:45:28.2417674Z Deployments: write
2021-02-22T07:45:28.2418095Z Issues: write
2021-02-22T07:45:28.2418497Z Metadata: read
2021-02-22T07:45:28.2418994Z OrganizationPackages: write
2021-02-22T07:45:28.2419596Z Packages: write
2021-02-22T07:45:28.2420072Z PullRequests: write
2021-02-22T07:45:28.2420603Z RepositoryProjects: write
2021-02-22T07:45:28.2421131Z SecurityEvents: write
2021-02-22T07:45:28.2421582Z Statuses: write
2021-02-22T07:45:28.2422103Z ##[endgroup]
2021-02-22T07:45:28.2425005Z Prepare workflow directory
2021-02-22T07:45:28.3029865Z Prepare all required actions
2021-02-22T07:45:28.3040060Z Getting action download info
2021-02-22T07:45:28.5737620Z Download action repository 'shogo82148/actions-cfn-lint@v1.6.15-beta3'
2021-02-22T07:45:30.5161751Z ##[group]Pull down action image 'shogo82148/actions-cfn-lint:1.6.15-beta3'
2021-02-22T07:45:30.5230235Z ##[command]/usr/bin/docker pull shogo82148/actions-cfn-lint:1.6.15-beta3
2021-02-22T07:45:31.6600579Z 1.6.15-beta3: Pulling from shogo82148/actions-cfn-lint
2021-02-22T07:45:31.6602146Z ba3557a56b15: Pulling fs layer
2021-02-22T07:45:31.6602994Z 9fd869580e22: Pulling fs layer
2021-02-22T07:45:31.6603748Z 9aa8fcef4f0c: Pulling fs layer
2021-02-22T07:45:31.6604968Z 08ac389ce2af: Pulling fs layer
2021-02-22T07:45:31.6605778Z 062fdfbade4d: Pulling fs layer
2021-02-22T07:45:31.6606502Z 08ac389ce2af: Waiting
2021-02-22T07:45:31.6607320Z 062fdfbade4d: Waiting
2021-02-22T07:45:31.7517952Z 9fd869580e22: Download complete
2021-02-22T07:45:31.7969563Z ba3557a56b15: Verifying Checksum
2021-02-22T07:45:31.7982984Z ba3557a56b15: Download complete
2021-02-22T07:45:31.9154147Z 062fdfbade4d: Verifying Checksum
2021-02-22T07:45:31.9156042Z 062fdfbade4d: Download complete
2021-02-22T07:45:31.9922894Z 08ac389ce2af: Verifying Checksum
2021-02-22T07:45:31.9928018Z 08ac389ce2af: Download complete
2021-02-22T07:45:32.1084027Z ba3557a56b15: Pull complete
2021-02-22T07:45:32.1707842Z 9aa8fcef4f0c: Verifying Checksum
2021-02-22T07:45:32.1709356Z 9aa8fcef4f0c: Download complete
2021-02-22T07:45:32.2057397Z 9fd869580e22: Pull complete
2021-02-22T07:45:35.2762879Z 9aa8fcef4f0c: Pull complete
2021-02-22T07:45:35.4664127Z 08ac389ce2af: Pull complete
2021-02-22T07:45:35.5298354Z 062fdfbade4d: Pull complete
2021-02-22T07:45:35.5341642Z Digest: sha256:fc2ada972d7458b1a5d2a3dea8e1bd0aadfd2fec929465765bd8c8cc50495ef7
2021-02-22T07:45:35.5408810Z Status: Downloaded newer image for shogo82148/actions-cfn-lint:1.6.15-beta3
2021-02-22T07:45:35.5421186Z docker.io/shogo82148/actions-cfn-lint:1.6.15-beta3
2021-02-22T07:45:35.5455144Z ##[endgroup]
2021-02-22T07:45:35.5726047Z ##[group]Run shogo82148/actions-cfn-lint@v1.6.15-beta3
2021-02-22T07:45:35.5726707Z with:
2021-02-22T07:45:35.5727746Z github_token: ***
2021-02-22T07:45:35.5728199Z cfn_lint_args: --config-file .cfnlintrc
2021-02-22T07:45:35.5728635Z level: error
2021-02-22T07:45:35.5728984Z tool_name: cfn-lint
2021-02-22T07:45:35.5729422Z reporter: github-pr-check
2021-02-22T07:45:35.5729843Z filter_mode: added
2021-02-22T07:45:35.5730219Z fail_on_error: false
2021-02-22T07:45:35.5730567Z ##[endgroup]
2021-02-22T07:45:35.5782442Z ##[command]/usr/bin/docker run --name shogo82148actionscfnlint1615beta3_b4deb5 --label 5588e4 --workdir /github/workspace --rm -e INPUT_GITHUB_TOKEN -e INPUT_CFN_LINT_ARGS -e INPUT_LEVEL -e INPUT_TOOL_NAME -e INPUT_REPORTER -e INPUT_FILTER_MODE -e INPUT_FAIL_ON_ERROR -e INPUT_REVIEWDOG_FLAGS -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/REDACTED_REPO_NAME/REDACTED_REPO_NAME":"/github/workspace" shogo82148/actions-cfn-lint:1.6.15-beta3 "**/*.yaml" "**/*.yml" "**/*.json"
2021-02-22T07:45:42.1776912Z 2021-02-22 07:45:42,176 - cfnlint.decode - ERROR - Template file not found: None
2021-02-22T07:45:42.5119590Z reviewdog: failed to run 'git rev-parse --show-prefix': exit status 128
2021-02-22T07:45:42.6432737Z Cleaning up orphan processes |
That's whole? You need to add |
@shogo82148 that was it. /me slaps forehead. Feel kind of dumb right now. 😄 Now it runs but I'm getting Run shogo82148/actions-cfn-lint@v1.6.15-beta3
with:
github_token: ***
cfn_lint_args: --config-file .cfnlintrc
level: error
tool_name: cfn-lint
reporter: github-pr-check
filter_mode: added
fail_on_error: false
/usr/bin/docker run --name shogo82148actionscfnlint1615beta3_b55ca0 --label 5588e4 --workdir /github/workspace --rm -e INPUT_GITHUB_TOKEN -e INPUT_CFN_LINT_ARGS -e INPUT_LEVEL -e INPUT_TOOL_NAME -e INPUT_REPORTER -e INPUT_FILTER_MODE -e INPUT_FAIL_ON_ERROR -e INPUT_REVIEWDOG_FLAGS -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/REDACTED_REPO_NAME/REDACTED_REPO_NAME":"/github/workspace" shogo82148/actions-cfn-lint:1.6.15-beta3 "**/*.yaml" "**/*.yml" "**/*.json"
reviewdog: Reporting results for "cfn-lint"
reviewdog: No results found for "cfn-lint". 259 results found outside diff. Am I missing something? name: Pull Request
on:
pull_request:
jobs:
Lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Cloudformation template linting
uses: shogo82148/actions-cfn-lint@v1.6.15-beta3
with:
github_token: ${{ secrets.REDACTED_KEY_NAME }}
cfn_lint_args: --config-file .cfnlintrc |
It works well. reviewdog reports lint warnings related with the pull request. please try to add some resources into your template. |
Ah, gotcha. Will test. Cheers. |
Ok. You can close this issue. I'm still trying to figure out the sequence where I can see all the linting errors in the entire repo outside the context of the PR but not have them error (only warn). May not be able to happen with |
Receive error above with this github action configuration:
I have
.json
files in the root of our repo and we have subfolders with the cloudformation yaml files. When I run the command line toolcfn-lint
directly I get the same error above when I use quotes (single or double)DOUBLE QUOTES
SINGLE QUOTES
USE
--template
in quotesWhen I don't use quotes with the cli tool it runs as expected
I understand yaml doesn't like me leaving it like this:
Errors with this:
Suggestion:
Turn this into an array so that I can do
or something else.
Have any ideas that I may just be missing or would you like a PR?
Thank you.
The text was updated successfully, but these errors were encountered: