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

feat(github-action): Implement cfn-guard as a Github Action in TS #510

Merged

Conversation

dannyvassallo
Copy link
Contributor

@dannyvassallo dannyvassallo commented May 23, 2024

Issue #, if available: N/A

Description of changes:

Utilizes the cfn-guard TS lib inside of a github action.

File changes primarily exist under action/src, action/__tests/, .github/workflows, and action.yml on the root.

If you want to read the changes like a compiler, start at action/src/main.ts

THIS DOES NOT INCLUDE FURTHER ATTRIBUTION AND DOES NOT INCLUDE README UPDATES


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Copy link
Contributor

@joshfried-aws joshfried-aws left a comment

Choose a reason for hiding this comment

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

Asside from some nits, this looks good to me.

I think we should add some lints. Personally I think we should enforce ; at the end of statements. I personally find it much easier to read with them.

action/__tests__/__mocks/mockSarif.ts Outdated Show resolved Hide resolved
action/__tests__/main.test.ts Outdated Show resolved Hide resolved
action/src/main.ts Outdated Show resolved Hide resolved
@dannyvassallo
Copy link
Contributor Author

Asside from some nits, this looks good to me.

I think we should add some lints. Personally I think we should enforce ; at the end of statements. I personally find it much easier to read with them.

Added semi rule with autoformatting.

@benbridts
Copy link
Contributor

Hey folks, I think this is awesome (looking very much forward to using it)!

One thing that would be interesting to consider (that's kinda independent of this PR), is if this should (also?) exist under https://github.com/aws-actions.
The main reason for that would be organisations allow-listing actions that can be used in their org. I think in practice it won't be a big hurdle to get both aws-actions and aws-cloudformation in an allow list, but for places where aws-actions is already allowed it's one step less.

@dannyvassallo
Copy link
Contributor Author

Hey folks, I think this is awesome (looking very much forward to using it)!

One thing that would be interesting to consider (that's kinda independent of this PR), is if this should (also?) exist under https://github.com/aws-actions. The main reason for that would be organisations allow-listing actions that can be used in their org. I think in practice it won't be a big hurdle to get both aws-actions and aws-cloudformation in an allow list, but for places where aws-actions is already allowed it's one step less.

@benbridts Hey! Great suggestion. During design we'd considered having the action live in it's own repo outside of the guard monorepo but ultimately decided on nesting it here. It's something to talk about though so while we have it here at least for now to do some testing, I'm bringing this back to the team to discuss. Thank you!

action/src/main.ts Show resolved Hide resolved
action/src/main.ts Outdated Show resolved Hide resolved
action/src/main.ts Outdated Show resolved Hide resolved
action/src/index.ts Show resolved Hide resolved
action/src/uploadCodeScan.ts Outdated Show resolved Hide resolved
action/src/uploadCodeScan.ts Outdated Show resolved Hide resolved
action/src/main.ts Outdated Show resolved Hide resolved
action/src/main.ts Show resolved Hide resolved
action/src/handlePushRun.ts Show resolved Hide resolved
action/src/handlePullRequestRun.ts Outdated Show resolved Hide resolved
@dannyvassallo dannyvassallo merged commit 37cc2ad into aws-cloudformation:action-develop May 24, 2024
2 checks passed
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.

4 participants