Skip to content

Instantly share code, notes, and snippets.

@IlyaFinkelshteyn
Created October 18, 2017 22:05
Show Gist options
  • Save IlyaFinkelshteyn/1deffbd1f73dee326aceb5de88524d6a to your computer and use it in GitHub Desktop.
Save IlyaFinkelshteyn/1deffbd1f73dee326aceb5de88524d6a to your computer and use it in GitHub Desktop.
#environment variables to set in build config
$env:gh_user = "<github_user>"
$env:gh_repo = "<github_repo>"
$env:gh_token = "<your_sha>" #secure variable
$headers = @{
"Authorization" = "Bearer $env:gh_token"
"Content-type" = "application/json"
}
$commit = Invoke-RestMethod -Uri "https://api.github.com/repos/$env:gh_user/$env:gh_repo/commits/$env:APPVEYOR_REPO_COMMIT" -Headers $headers -Method GET
Write-host "Files changed:"
$commit.files | % {$_.filename}
if (($commit.files.filename -like "*.md") -and !($commit.files.filename -notlike "*.md")) {
Write-host "only *.md files found, exiting..."; Exit-AppveyorBuild
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment