-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (54 loc) · 1.53 KB
/
pipeline.yml
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
54
55
56
57
58
59
# workflow name
name: CLI Pipeline
# define when the workflow should be triggered
# this workflow is triggered on any push to any branch
# and on pull requests with specific events
on:
push:
branches: ["*"]
pull_request:
branches: ["*"]
types:
- opened
- edited
- reopened
- synchronize
# permissions required for the workflow
# the workflow needs read permissions for repository contents and packages
permissions:
contents: read
packages: read
# define jobs to be run
jobs:
# job to checkout the repository and set up the environment
checkout-and-setup:
name: "1. Checkout and Setup"
runs-on: ubuntu-latest
outputs:
# output of the checkout step
checkout-dir: ${{ steps.checkout.outputs.dir }}
steps:
- name: Checkout Repository
id: checkout
uses: actions/checkout@v4
with:
# fetch all history for all branches and tags
fetch-depth: 0
# ===============
# job to run a security scan using gitleaks
security-scan:
name: "2. Run Security Scan"
# depends on the completion of the checkout-and-setup job
needs: checkout-and-setup
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
# fetch all history for all branches and tags
fetch-depth: 0
- name: Run Security Scanner
uses: gitleaks/gitleaks-action@v2
env:
# token for accessing the GitHub API
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}