Skip to content

Commit 0487834

Browse files
add in the secret-scanning custom action
additionally parameratise the PMD version
1 parent f3f7692 commit 0487834

File tree

3 files changed

+35
-17
lines changed

3 files changed

+35
-17
lines changed

.github/workflows/code-analysis.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ jobs:
1313
- uses: actions/checkout@v4
1414

1515
- name: Install PMD CLI
16+
env:
17+
PMD_VERSION: '7.13.0'
1618
run: |
17-
curl -L -o pmd-dist-7.13.0-bin.zip https://github.com/pmd/pmd/releases/download/pmd_releases%2F7.13.0/pmd-dist-7.13.0-bin.zip
18-
unzip pmd-dist-7.13.0-bin.zip
19-
mv pmd-bin-7.13.0 /opt/pmd
19+
curl -L -o pmd-dist-$PMD_VERSION-bin.zip https://github.com/pmd/pmd/releases/download/pmd_releases%2F$PMD_VERSION/pmd-dist-$PMD_VERSION-bin.zip
20+
unzip pmd-dist-$PMD_VERSION-bin.zip
21+
mv pmd-bin-$PMD_VERSION /opt/pmd
2022
echo "/opt/pmd/bin" >> $GITHUB_PATH
2123
2224
- name: Run PMD CLI analysis
@@ -57,15 +59,3 @@ jobs:
5759
echo "PMD violations found"
5860
exit 1
5961
fi
60-
61-
secret-scanning:
62-
runs-on: ubuntu-latest
63-
steps:
64-
- name: Checkout code
65-
uses: actions/checkout@v4
66-
with:
67-
fetch-depth: 0
68-
- name: Secret Scanning
69-
uses: trufflesecurity/trufflehog@main
70-
with:
71-
extra_args: --results=verified,unknown

.github/workflows/codeql.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
languages: ${{ matrix.language }}
3737
queries: security-extended
3838

39+
3940
- uses: actions/setup-java@v4
4041
with:
4142
distribution: 'temurin'
@@ -46,9 +47,14 @@ jobs:
4647
with:
4748
gradle-version: current
4849

49-
- name: Gradle Build
50+
- name: Gradle Build and Publish
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5053
run: |
51-
gradle build cyclonedxBom -x test
54+
gradle build cyclonedxBom -x test \
55+
-DGITHUB_REPOSITORY=${{ github.repository }} \
56+
-DGITHUB_ACTOR=${{ github.actor }} \
57+
-DGITHUB_TOKEN=$GITHUB_TOKEN
5258
5359
# ℹ️ Command-line programs to run using the OS shell.
5460
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Secret Scanning
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
- main
7+
schedule:
8+
- cron: '0 4 * * 4' # Every Thursday at 04:00
9+
workflow_dispatch:
10+
11+
jobs:
12+
scan:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- uses: hmcts/secrets-scanner@main
20+
with:
21+
github_token: ${{ secrets.GITHUB_TOKEN }}
22+
gitleaks_license: ${{ secrets.GITLEAKS_LICENSE }}

0 commit comments

Comments
 (0)