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

Extend version input to allow dependencies and specifier #471

Merged
merged 4 commits into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading