-
-
Save OldCrowEW/8191c7d27f664bc5c5452066dd519f31 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def overridePolicy(policyid) { | |
def response = httpRequest( | |
customHeaders: [ | |
[ name: "Authorization", value: "Bearer " + env.BEARER_TOKEN ], | |
[ name: "Content-Type", value: "application/vnd.api+json" ] | |
], | |
httpMode: 'POST', | |
url: "https://app.terraform.io/api/v2/policy-checks/${policyid}/actions/override" | |
) | |
def data = new JsonSlurper().parseText(response.content) | |
if (data.data.attributes.status != "overridden") { | |
return false | |
} | |
else { | |
return true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment