Skip to content

Commit bb9c17b

Browse files
authored
🥁 [gha] Add auto-assign and Checkov (#50)
* 🥁 [gha] Add auto-assign and Checkov * fix global permissions for github pages GHA
1 parent eadd44a commit bb9c17b

File tree

4 files changed

+76
-0
lines changed

4 files changed

+76
-0
lines changed

.github/workflows/auto-assign.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
me: Auto Assign
2+
on:
3+
issues:
4+
types: [opened]
5+
pull_request:
6+
types: [opened]
7+
jobs:
8+
run:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
pull-requests: write
13+
steps:
14+
- name: 'Auto-assign issue'
15+
uses: pozil/auto-assign-issue@v1
16+
with:
17+
repo-token: ${{ secrets.GITHUB_TOKEN }}
18+
assignees: chicks-net
19+
numOfAssignee: 1

.github/workflows/checkov.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Checkov
2+
3+
# Controls when the workflow will run
4+
on:
5+
# Triggers the workflow on push or pull request events but only for the "main" branch
6+
push:
7+
branches: [ "main" ]
8+
pull_request:
9+
branches: [ "main" ]
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# global permissions
15+
permissions: read-all
16+
17+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
18+
jobs:
19+
# This workflow contains a single job called "scan"
20+
scan:
21+
permissions:
22+
contents: read # for actions/checkout to fetch code
23+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
24+
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
25+
26+
# The type of runner that the job will run on
27+
runs-on: ubuntu-latest
28+
29+
# Steps represent a sequence of tasks that will be executed as part of the job
30+
steps:
31+
# Checks-out your repository under $GITHUB_WORKSPACE, so follow-up steps can access it
32+
- uses: actions/checkout@v4
33+
34+
- name: Checkov GitHub Action
35+
uses: bridgecrewio/checkov-action@v12
36+
with:
37+
# This will add both a CLI output to the console and create a results.sarif file
38+
output_format: cli,sarif
39+
output_file_path: console,results.sarif
40+
41+
- name: Upload SARIF file
42+
uses: github/codeql-action/upload-sarif@v3
43+
44+
# Results are generated only on a success or failure
45+
# this is required since GitHub by default won't run the next step
46+
# when the previous one has failed. Security checks that do not pass will 'fail'.
47+
# An alternative is to add `continue-on-error: true` to the previous step
48+
# Or 'soft_fail: true' to checkov.
49+
if: success() || failure()
50+
with:
51+
sarif_file: results.sarif

.github/workflows/github-pages.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches:
66
- 'main'
77

8+
# global permissions
9+
permissions: read-all
10+
811
jobs:
912
publish:
1013
permissions:

.github/workflows/markdownlint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- main
77
pull_request:
88

9+
# global permissions
10+
permissions: read-all
11+
912
jobs:
1013
lint:
1114
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)