Skip to content
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

Match AWS States file using "States" JSON key #1949

Merged
merged 3 commits into from
Sep 9, 2021
Merged

Match AWS States file using "States" JSON key #1949

merged 3 commits into from
Sep 9, 2021

Conversation

t-botz
Copy link
Contributor

@t-botz t-botz commented Sep 9, 2021

Proposed Changes

Matching only on "Resource": "arn is too wide and will match also aws json policy files for example.
Given the keys States and StartAt are required in any states file it makes sense to use one of them to narrow it down (why not even both...)

Readiness Checklist

Author/Contributor

  • If documentation is needed for this change, has that been included in this pull request

Reviewing Maintainer

  • Label as breaking if this is a large fundamental change
  • Label as either automation, bug, documentation, enhancement, infrastructure, or performance

Matching only on `"Resource": "arn` is too wide and will match also aws json policy files
@@ -203,8 +203,8 @@ DetectAWSStatesFIle() {
###############################
# check if file has resources #
###############################
if grep -q '"Resource": *"arn"*' "${FILE}"; then
Copy link
Contributor Author

@t-botz t-botz Sep 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"* at the end of the pattern seems unnecessary.
Thinking about it, x*, no matter x, at the beginning or the end of a grep pattern brings no value. That should probably be a lint rule in somewhere! :)

@t-botz t-botz changed the title Match AWS states file using "States" JSON key Match AWS States file using "States" JSON key Sep 9, 2021
admiralAwkbar
admiralAwkbar previously approved these changes Sep 9, 2021
@admiralAwkbar admiralAwkbar self-assigned this Sep 9, 2021
@admiralAwkbar admiralAwkbar merged commit a3ad489 into super-linter:master Sep 9, 2021
@t-botz t-botz deleted the patch-1 branch September 9, 2021 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants