From 2cd7c7a357cac76d33f9d43263e1a6a5c2da0d10 Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Thu, 28 Apr 2022 16:51:53 +0800 Subject: [PATCH 1/3] Ensure analysis job never runs on forked repos --- .github/workflows/codacy-analysis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/codacy-analysis.yml b/.github/workflows/codacy-analysis.yml index bbc5bc09d9..e7d73fa772 100644 --- a/.github/workflows/codacy-analysis.yml +++ b/.github/workflows/codacy-analysis.yml @@ -19,6 +19,8 @@ on: jobs: codacy-security-scan: + # Ensure this job never runs on forked repos. It's only executed for 'snipe/snipe-it' + if: github.repository == 'snipe/snipe-it' name: Codacy Security Scan runs-on: ubuntu-latest steps: From a835401cb2ac63dee9802e665f3bbdd2ee0ee835 Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Sat, 7 May 2022 22:50:01 +0800 Subject: [PATCH 2/3] skip run schedule analysis job on forked repos --- .github/workflows/codacy-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codacy-analysis.yml b/.github/workflows/codacy-analysis.yml index e7d73fa772..c2df7678b5 100644 --- a/.github/workflows/codacy-analysis.yml +++ b/.github/workflows/codacy-analysis.yml @@ -20,7 +20,7 @@ on: jobs: codacy-security-scan: # Ensure this job never runs on forked repos. It's only executed for 'snipe/snipe-it' - if: github.repository == 'snipe/snipe-it' + if: (github.repository == 'snipe/snipe-it') && ((github.repository != 'snipe/snipe-it') && (github.event_name != 'schedule')) name: Codacy Security Scan runs-on: ubuntu-latest steps: From 8a032ee0409be04483ed5181296d7c36d670c412 Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Sat, 7 May 2022 22:54:47 +0800 Subject: [PATCH 3/3] fix type --- .github/workflows/codacy-analysis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codacy-analysis.yml b/.github/workflows/codacy-analysis.yml index c2df7678b5..81917e6b6a 100644 --- a/.github/workflows/codacy-analysis.yml +++ b/.github/workflows/codacy-analysis.yml @@ -19,8 +19,8 @@ on: jobs: codacy-security-scan: - # Ensure this job never runs on forked repos. It's only executed for 'snipe/snipe-it' - if: (github.repository == 'snipe/snipe-it') && ((github.repository != 'snipe/snipe-it') && (github.event_name != 'schedule')) + # Ensure schedule job never runs on forked repos. It's only executed for 'snipe/snipe-it' + if: (github.repository == 'snipe/snipe-it') || ((github.repository != 'snipe/snipe-it') && (github.event_name != 'schedule')) name: Codacy Security Scan runs-on: ubuntu-latest steps: