Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Created October 12, 2021 15:07
Show Gist options
  • Save KyMidd/3ebde8b75a7628961df257ce51944ad8 to your computer and use it in GitHub Desktop.
Save KyMidd/3ebde8b75a7628961df257ce51944ad8 to your computer and use it in GitHub Desktop.
# Add idempotence circuit breaker by checking md5 of old vs new file
newFileMd5=$(md5sum ../../actions-runner/_work/TfGithubAutomation/TfGithubAutomation/commit_checker/github_commit_checker.yml.template 2>/dev/null | cut -d " " -f 1)
existingFileMd5=$(md5sum .github/workflows/_PfGitCommitChecker.yml 2>/dev/null | cut -d " " -f 1)
# If md5 match, continue to next iteration of loop
if [[ $newFileMd5 == $existingFileMd5 ]]; then
echo "Actions file has not changed, continuing to next iteration of loop"
continue
else
echo "Actions file is missing or has changed, attempting to open new PR"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment