Skip to content

Commit

Permalink
Add fabasoad/pre-commit-grype hook (#164)
Browse files Browse the repository at this point in the history
<!-- markdownlint-disable-file MD041 -->

## Pull request checklist

Please check if your PR fulfills the following requirements:

- [ ] I have read the
[CONTRIBUTING](https://github.com/fabasoad/setup-kitten-action/blob/main/CONTRIBUTING.md)
      doc.
- [ ] Tests for the changes have been added (for bug fixes / features).
- [ ] Docs have been reviewed and added / updated if needed (for bug
fixes / features).

## Pull request type

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type, submit multiple
pull
requests if needed. -->

Please check the type of change your PR introduces:

- [ ] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] Other (please describe):

## What is the current behavior

<!-- Please describe the current behavior that you are modifying, or
link to a
relevant issue. -->

## What is the new behavior

<!-- Please describe the behavior or changes that are being added by
this PR. -->

-
-
-

## Does this introduce a breaking change

- [ ] Yes
- [ ] No

<!-- If this introduces a breaking change, please describe the impact
and
migration path for existing applications below. -->

## Other information

<!-- Any other information that is important to this PR such as
screenshots of
how the component looks before and after the change. -->
<!-- This document was adapted from the open-source
[appium/appium](https://github.com/appium/appium/blob/master/.github/PULL_REQUEST_TEMPLATE.md)
repository. -->

---

Closes #{IssueNumber}
  • Loading branch information
fabasoad authored Aug 3, 2024
1 parent 91b1042 commit 7d80d7c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 16 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,12 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ["ubuntu", "macos", "windows"]
runs-on: ${{ matrix.os }}-latest
runner: ["ubuntu-latest", "macos-12", "windows-latest"]
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4
- name: Setup Kitten
id: setup-kitten
continue-on-error: true
uses: ./
- name: Run script
if: ${{ steps.setup-kitten.outcome == 'success' }}
run: kitten ./hello-world.ktn
- name: Validate outcome
run: |
if [ "${RUNNER_OS}" != "macOS" ] && [ "${{ steps.setup-kitten.outcome }}" = "failure" ]; then
exit 1
fi
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ repos:
rev: v8.18.4
hooks:
- id: gitleaks
- repo: https://github.com/fabasoad/pre-commit-grype
rev: v0.6.0
hooks:
- id: grype-dir
args:
- --grype-args=--by-cve --fail-on=low
- --hook-args=--log-level debug
stages: ["push"]
# Markdown
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.41.0
Expand All @@ -31,6 +39,13 @@ repos:
- id: actionlint
args: ["-pyflakes="]
stages: ["commit"]
# Shell
- repo: https://github.com/openstack/bashate
rev: 2.1.1
hooks:
- id: bashate
args: ["-i", "E003,E006"]
stages: ["commit"]
# Other
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
Expand Down
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,23 @@

This action sets up a [Kitten](http://kittenlang.org/).

## Supported OS

<!-- prettier-ignore-start -->
| OS | Arch | |
|---------|--------|--------------------|
| Windows | x86_84 | :white_check_mark: |
| Windows | arm | :x: |
| Linux | x86_84 | :white_check_mark: |
| Linux | arm | :x: |
| macOS | x86_84 | :white_check_mark: |
| macOS | arm | :x: |
<!-- prettier-ignore-end -->

## Prerequisites

None.

> `macOS` is not supported at this moment
## Example usage

Let's try to run `hello-world.ktn` file with the following content:
Expand Down
4 changes: 0 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ branding:
runs:
using: "composite"
steps:
- name: Fail
if: ${{ runner.os == 'macOS' }}
run: echo "::error::${RUNNER_OS} ${RUNNER_ARCH} is not supported" && exit 1
shell: sh
- name: Collect info
id: info
run: |
Expand Down

0 comments on commit 7d80d7c

Please sign in to comment.