Skip to content

Commit ffc6838

Browse files
authored
build: improve GHA workflow experience for forks (#8285)
2 parents 91dcd37 + 835494c commit ffc6838

File tree

5 files changed

+6
-20
lines changed

5 files changed

+6
-20
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Install gpg secret key
21+
if: github.repository_owner == 'dependency-check'
2122
id: install-gpg-key
2223
run: |
2324
cat <(echo -e "${{ secrets.GPG_PRIVATE_KEY }}") | gpg --batch --import
@@ -65,7 +66,7 @@ jobs:
6566
MAVEN_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
6667
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PRIVATE_KEY_PASSWORD }}
6768
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
68-
run: mvn -V -s settings.xml -Prelease clean package verify source:jar javadoc:jar gpg:sign deploy -DreleaseTesting --no-transfer-progress --batch-mode
69+
run: mvn -V -s settings.xml clean package verify source:jar javadoc:jar ${{ steps.install-gpg-key.outcome == 'success' && '-Prelease gpg:sign deploy' || '' }} -DreleaseTesting --no-transfer-progress --batch-mode
6970
- name: SARIF Multitool
7071
uses: microsoft/sarif-actions@v0.2
7172
with:
@@ -101,31 +102,13 @@ jobs:
101102
ant/target/*.zip
102103
cli/target/*.zip
103104
104-
# publish_coverage:
105-
# name: publish code coverage reports
106-
# runs-on: ubuntu-latest
107-
# needs: build
108-
# steps:
109-
# - name: Download coverage reports
110-
# uses: actions/download-artifact@v7
111-
# with:
112-
# name: code-coverage-report
113-
# - name: Run codacy-coverage-reporter
114-
# uses: codacy/codacy-coverage-reporter-action@master
115-
# with:
116-
# project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
117-
# coverage-reports: utils/target/jacoco-results/jacoco.xml,core/target/jacoco-results/jacoco.xml,maven/target/jacoco-results/jacoco.xml,ant/target/jacoco-results/jacoco.xml,cli/target/jacoco-results/jacoco.xml
118-
119105
docker:
120106
permissions:
121107
contents: read # to fetch code (actions/checkout)
122108

123109
name: Build and Test Docker
124110
runs-on: ubuntu-latest
125111
needs: build
126-
env:
127-
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
128-
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
129112
steps:
130113
- name: Checkout code
131114
uses: actions/checkout@v6

.github/workflows/false-positive-cleanup.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
permissions: {}
88
jobs:
99
cleanup:
10+
if: github.repository_owner == 'dependency-check'
1011
permissions:
1112
actions: write # to delete workflow runs
1213

.github/workflows/lock.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ concurrency:
1515

1616
jobs:
1717
action:
18+
if: github.repository_owner == 'dependency-check'
1819
runs-on: ubuntu-latest
1920
steps:
2021
- uses: dessant/lock-threads@v6

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ on:
1818

1919
jobs:
2020
build:
21+
if: github.repository_owner == 'dependency-check'
2122
name: Build dependency-check
2223
runs-on: ubuntu-latest
2324
steps:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Maven Central](https://img.shields.io/maven-central/v/org.owasp/dependency-check-maven.svg)](https://mvnrepository.com/artifact/org.owasp/dependency-check-maven) [![Build and Deploy Snapshot](https://github.com/dependency-check/DependencyCheck/actions/workflows/build.yml/badge.svg)](https://github.com/dependency-check/DependencyCheck/actions/workflows/build.yml) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/6b6021d481dc41a888c5da0d9ecf9494)](https://www.codacy.com/app/jeremylong/DependencyCheck?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=jeremylong/DependencyCheck&amp;utm_campaign=Badge_Grade) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/843/badge)](https://bestpractices.coreinfrastructure.org/projects/843) [![Apache 2.0 License](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0.txt)
1+
[![Maven Central](https://img.shields.io/maven-central/v/org.owasp/dependency-check-maven.svg)](https://mvnrepository.com/artifact/org.owasp/dependency-check-maven) [![Build and Deploy Snapshot](https://github.com/dependency-check/DependencyCheck/actions/workflows/build.yml/badge.svg)](https://github.com/dependency-check/DependencyCheck/actions/workflows/build.yml) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/843/badge)](https://bestpractices.coreinfrastructure.org/projects/843) [![Apache 2.0 License](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0.txt)
22

33
[![Black Hat Arsenal](https://raw.githubusercontent.com/toolswatch/badges/master/arsenal/usa/2018.svg?sanitize=true)](https://www.blackhat.com/us-18/arsenal.html#jeremy-long) [![Black Hat Arsenal](https://raw.githubusercontent.com/toolswatch/badges/master/arsenal/usa/2015.svg?sanitize=true)](https://www.blackhat.com/us-15/arsenal.html#jeremy-long) [![Black Hat Arsenal](https://raw.githubusercontent.com/toolswatch/badges/master/arsenal/usa/2014.svg?sanitize=true)](https://www.blackhat.com/us-14/arsenal.html#Long) [![Black Hat Arsenal](https://raw.githubusercontent.com/toolswatch/badges/master/arsenal/usa/2013.svg?sanitize=true)](https://www.blackhat.com/us-13/arsenal.html#Long)
44

0 commit comments

Comments
 (0)