Repository navigation
53 lines (50 loc) · 2.26 KB
/
Copy pathpre-commit-cache.yaml
File metadata and controls
53 lines (50 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
name: pre-commit cache
on: # yamllint disable-line rule:truthy
push:
branches: ["dev", "develop", "main", "master"]
schedule:
# GitHub Actions does not support the non-standard syntax @monthly, @weekly, @daily, etc.
# - cron: "15 0 * * *" # daily at 00:15 UTC
- cron: "15 0 1 * *" # low activity repos can do just the first day of the month at 00:15 UTC
# to have an ability to run the workflow manually
workflow_dispatch: # yamllint disable-line rule:empty-values
permissions:
contents: write # required for trivy to upload artifacts
security-events: write # required for trivy to upload SARIF to GitHub Security tab (master only)
actions: write # required for trivy to upload SBOM artifact (master only)
jobs:
pre-commit:
name: pre-commit-cache
runs-on: ubuntu-latest
steps:
- name: Mint ik-code-reader installation token
id: code_reader_token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0 - https://github.com/actions/create-github-app-token/releases
with:
client-id: ${{ vars.IK_CODE_READER_CLIENT_ID }}
private-key: ${{ secrets.IK_CODE_READER_PEM }}
owner: indykite
repositories: ops-common
- name: pre-commit
uses: indykite/.github/.github/actions/pre-commit@master
with:
github_token: ${{ steps.code_reader_token.outputs.token }}
pre_commit_skip: >-
commitlint,trivy,trivy-conf,trivy-filesystem,trivy-licenses
${{ vars.PRE_COMMIT_SKIP != null && ',' || '' }}${{ vars.PRE_COMMIT_SKIP }}
${{ format('{0}', github.event_name != 'pull_request' && ',pre-commit-autoupdate,no-commit-to-branch' || '' ) }}
trivy:
name: trivy
runs-on: ubuntu-latest
steps:
- name: trivy
uses: indykite/.github/.github/actions/trivy@master
with:
scanners: vuln,secret,misconfig,license
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
jira-api-token: ${{ secrets.JIRA_API_TOKEN }}
jira-cloud-id: ${{ secrets.JIRA_CLOUD_ID }}
jira-watchers: ${{ secrets.TRIVY_JIRA_WATCHERS }}
github-app-client-id: ${{ vars.IK_CODE_WRITER_CLIENT_ID }}
github-app-private-key: ${{ secrets.IK_CODE_WRITER_PEM }}