From 5ed6c932a342202491ddd1df1016b1b1d9d5882d Mon Sep 17 00:00:00 2001 From: Sierra Taylor Moxon Date: Wed, 27 Sep 2023 14:18:41 -0700 Subject: [PATCH] simplify script --- .github/workflows/check-watchdog.yaml | 9 +-------- Jenkinsfile | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/check-watchdog.yaml b/.github/workflows/check-watchdog.yaml index 3e8d7c4..5878870 100644 --- a/.github/workflows/check-watchdog.yaml +++ b/.github/workflows/check-watchdog.yaml @@ -20,14 +20,7 @@ jobs: - name: Check for modifications in the watchdog function run: | set -x - MODIFIED_LINES=$(git diff --unified=0 master ${{ github.head_ref }} Jenkinsfile | grep 'void watchdog()') - - # Debug: Print the entire git diff output for Jenkinsfile - echo "Full git diff output for Jenkinsfile:" - git diff --unified=0 master issue-325-gopreprocess Jenkinsfile - echo "-------------------------" - - if [[ ! -z "$MODIFIED_LINES" ]]; then + if $(git diff --unified=0 master ${{ github.head_ref }} Jenkinsfile | grep 'void watchdog()'); then echo "ERROR: The watchdog function in the Jenkinsfile has been modified." exit 1 else diff --git a/Jenkinsfile b/Jenkinsfile index 2760f46..9b5488f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1477,7 +1477,7 @@ pipeline { void watchdog() { if( BRANCH_NAME != 'master' && TARGET_BUCKET == 'go-data-product-experimental'){ echo 'Only master can touch that target.' - sh '`exit -1`' erterterter + sh '`exit -1`' }else if( BRANCH_NAME != 'snapshot' && TARGET_BUCKET == 'go-data-product-snapshot'){ echo 'Only master can touch that target.' sh '`exit -1`'