forked from aws-cloudformation/cloudformation-guard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(github-action): Provide GitHub action aws-cloudformation#93 (aws…
…-cloudformation#514) Merge GIthub Action Feature branch into main
- Loading branch information
1 parent
719a44a
commit 4cfc6ae
Showing
48 changed files
with
43,704 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* text=auto eol=lf | ||
|
||
action/dist/** -diff linguist-generated=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,31 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for more information: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
# https://containers.dev/guide/dependabot | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "devcontainers" | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
- package-ecosystem: github-actions | ||
directory: /action | ||
schedule: | ||
interval: weekly | ||
groups: | ||
actions-minor: | ||
update-types: | ||
- minor | ||
- patch | ||
|
||
- package-ecosystem: npm | ||
directory: /action | ||
schedule: | ||
interval: weekly | ||
groups: | ||
npm-development: | ||
dependency-type: development | ||
update-types: | ||
- minor | ||
- patch | ||
npm-production: | ||
dependency-type: production | ||
update-types: | ||
- patch | ||
|
||
- package-ecosystem: "devcontainers" | ||
directory: "/" | ||
schedule: | ||
interval: weekly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Github Action CI | ||
on: | ||
push: | ||
paths: | ||
- 'action/**' | ||
- 'action.yml' | ||
pull_request: | ||
paths: | ||
- 'action/**' | ||
- 'action.yml' | ||
jobs: | ||
run-unit-tests: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./action | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v4.0.2 | ||
with: | ||
node-version: '20' | ||
- run: npm install | ||
- run: npm run lint | ||
- run: npm run format:check | ||
- run: npm run test | ||
- run: npm run package | ||
# This will fail the workflow if the `dist/` directory is different than | ||
# expected. | ||
- name: Compare Directories | ||
id: diff | ||
run: | | ||
if [ ! -d dist/ ]; then | ||
echo "Expected dist/ directory does not exist. See status below:" | ||
ls -la ./ | ||
exit 1 | ||
fi | ||
if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then | ||
echo "Detected uncommitted changes after build. See status below:" | ||
git diff --ignore-space-at-eol --text dist/ | ||
exit 1 | ||
fi | ||
# If `dist/` was different than expected, upload the expected version as a | ||
# workflow artifact. | ||
- if: ${{ failure() && steps.diff.outcome == 'failure' }} | ||
name: Upload Artifact | ||
id: upload | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist | ||
path: dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: 'CloudFormation Guard GitHub Action' | ||
description: 'Validate templates using CloudFormation Guard' | ||
author: 'Amazon Web Services' | ||
|
||
branding: | ||
icon: 'shield' | ||
color: 'orange' | ||
|
||
inputs: | ||
rules: | ||
description: 'Guard rules path relative to the root of the repository.' | ||
required: true | ||
default: '.' | ||
data: | ||
description: 'Template data path relative to the root of the repository.' | ||
required: true | ||
default: '.' | ||
token: | ||
description: 'GitHub token for API calls.' | ||
required: false | ||
default: ${{ github.token }} | ||
checkout: | ||
description: 'Checkout the repository if not using a composite action where cfn-guard follows actions/checkout.' | ||
required: false | ||
default: 'true' | ||
analyze: | ||
description: 'Upload the SARIF report to GitHubs code scanning dashboard.' | ||
required: false | ||
default: 'false' | ||
create-review: | ||
description: 'Create a pull request review with comments during pull request checks.' | ||
required: false | ||
default: 'true' | ||
|
||
outputs: | ||
report: | ||
description: 'Stringified report from cfn-guard' | ||
|
||
runs: | ||
using: node20 | ||
main: ./action/dist/index.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
lib/ | ||
dist/ | ||
node_modules/ | ||
coverage/ |
Oops, something went wrong.