Skip to content

Commit

Permalink
Extend version input to allow dependencies and specifier (#471)
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottBrenner authored Jan 18, 2025
1 parent 05b2298 commit 0696545
Show file tree
Hide file tree
Showing 8 changed files with 304 additions and 827 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Setup Cloud Formation Linter with Specific Version
uses: ./
with:
version: "0.72.0"
version: "[sarif]>=1.0"
# Step 5
- name: Print the Cloud Formation Linter Version & run Linter.
run: |
Expand Down
32 changes: 27 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,33 @@ jobs:

Further, you can configure this action to download a specific version of the [CloudFormation Linter](https://github.com/aws-cloudformation/cfn-python-lint/), as well as the Python interpreter. See the table below for all the `INPUTS` this action can take.

| Input Name | Input Description | Default Value | Required? |
| ---------- | --------------------------------------------------- | --------------------------------------------------------- | --------- |
| version | Version of CFN PyPi Package | Latest Version of CFN PyPi Package | false |
| python | Python Version | Defaults to `python` on Windows, and `python3` otherwise. | false |
| command | Cloud Formation Linter Command to Run After Install | N/A | false |
| Input Name | Input Description | Default Value | Required? |
| ---------- | --------------------------------------------------- | --------------------------------------------------------------------- | --------- |
| version | Version of CFN PyPi Package | Latest Version of CFN PyPi Package with all the optional dependencies | false |
| python | Python Version | Defaults to `python` on Windows, and `python3` otherwise. | false |
| command | Cloud Formation Linter Command to Run After Install | N/A | false |

[Optional dependencies](https://github.com/aws-cloudformation/cfn-lint?tab=readme-ov-file#optional-dependencies) and [version specifier](https://peps.python.org/pep-0440/#version-specifiers) can be input as follows:

```yaml
name: Lint CloudFormation Templates
on: [push]
jobs:
cloudformation-linter:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Testing with CFN Lint Command
uses: scottbrenner/cfn-lint-action@v2
with:
version: "[sarif]>=1.0"
command: cfn-lint -t ./template.yml
```

This GitHub Action does not directly output any values.

Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ branding:
color: "orange"
inputs:
version:
description: "The version of the AWS CloudFormation Linter you would like to install"
description: "The version of the AWS CloudFormation Linter you would like to install, along with optional dependencies and specifier"
required: false
python:
description: "The Python interpreter to use for AWS CFN LINT"
Expand Down
Loading

0 comments on commit 0696545

Please sign in to comment.