Skip to content

Instantly share code, notes, and snippets.

@KyMidd

KyMidd/asd.fsh Secret

Last active February 19, 2023 18:23
Show Gist options
  • Save KyMidd/d22583d8172ead4748d10425a47c9aa7 to your computer and use it in GitHub Desktop.
Save KyMidd/d22583d8172ead4748d10425a47c9aa7 to your computer and use it in GitHub Desktop.
# Download the job XML
echo "- Downloading job xml/${job}_original.xml"
#rm xml/${job}_original.xml
curl -s -u "$JENKINS_USERNAME:$api_token" -X GET "https://$JENKINS_URL/job/${job}/config.xml" > xml/${job}_original.xml
# Check the git source
if [[ $(cat xml/${job}_original.xml | yq -p xml .project.scm.userRemoteConfigs | grep url) == *"github"* ]]; then
echo "✅ The pipeline already points at github, and requires no changes"
else
# Changes needed
echo "🚧 Pipeline needs changes"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment