Skip to content

Commit

Permalink
simplify script
Browse files Browse the repository at this point in the history
  • Loading branch information
sierra-moxon committed Sep 27, 2023
1 parent bb9373e commit 5ed6c93
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/check-watchdog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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`'
Expand Down

0 comments on commit 5ed6c93

Please sign in to comment.