Skip to content

Commit

Permalink
feat(SETI-959): Add ability to skip checks (#40)
Browse files Browse the repository at this point in the history
* feat(SETI-959): Add ability to skip checks

* feat(SETI-959): Add skipCheck to action inputs

* feat(SETI-959): Add name for workflow test and update README

* feat(SETI-959): Check for bot skipping earlier to make it clearer

* feat(SETI-959): fix name of secrets-scan check when skipping

Also make output groups only during the check execution to make
skipping and error clearer
  • Loading branch information
Kao Félix authored Jun 14, 2021
1 parent aa3a9f1 commit 6325bfb
Show file tree
Hide file tree
Showing 15 changed files with 4,329 additions and 270 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/test-and-release-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,20 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: ./
- name: Test all checks
uses: ./
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
dockerUsername: ${{ secrets.GITLEAKS_DOCKER_USERNAME }}
dockerPassword: ${{ secrets.GITLEAKS_DOCKER_PASSWORD }}

- name: Test skipping checks
uses: ./
with:
skipChecks: 'jira-linked,secrets-scan'
githubToken: ${{ secrets.GITHUB_TOKEN }}
dockerUsername: ${{ secrets.GITLEAKS_DOCKER_USERNAME }}
dockerPassword: ${{ secrets.GITLEAKS_DOCKER_PASSWORD }}
release: # this releases in beta
needs: [build, test]
runs-on: ubuntu-latest
Expand All @@ -40,7 +49,7 @@ jobs:
id: semantic
uses: codfish/semantic-release-action@4e9fa8ec064813465dfeccac8ae70f1348fb5dec
with:
repository_url: https://github.com/Typeform/ci-standard-checks.git
repository_url: https://github.com/Typeform/ci-standard-checks.git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update major version tag
Expand Down
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ Typeform organisation in a single central place, so that teams have an
easier time adopting them in their CI and platform teams have an
easier time rolling out new checks to teams. Win-win!

Right now, included checks are:
## Included Checks

- jira-linked: never forget a Jira Issue key in your commits or PRs
- *jira-linked*: never forget a Jira Issue key in your commits or PRs
again!
- secret-scan: make sure you're never ever ever commiting a secret to
- *secrets-scan*: make sure you're never ever ever commiting a secret to
your repo. _Shhh, it's a secret_ :shushing_face:

## How to use it
Expand All @@ -25,6 +25,23 @@ repo, and it looks like this:

![Workflow Template](./docs/workflow-template.png)

### Skipping Checks

It might be that some of the checks don't make sense for your
particular case. In that case, you can provide `skipChecks` as an
input with the names of the checks you want to skip separated by
commas:

``` yaml
...
with:
skipChecks: 'jira-linked,secret-scan'
...
```

Refer to the [list of checks](#included-checks) for the proper names
to use.

## Adding new Checks

We use GitHub actions toolkit. See the [toolkit
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: 'CI Standard Checks'
description: 'Runs Standard Checks for Typeform'
author: 'Typeform'
inputs:
skipChecks:
required: true
default: ''
description: 'Checks to be skipped'
githubToken:
required: true
description: 'The github token to get PR info when checking for Jira Issue key'
Expand Down
Loading

0 comments on commit 6325bfb

Please sign in to comment.