Skip to content

Commit

Permalink
Fixing github uri parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
serialseb committed Feb 28, 2017
1 parent 94edf71 commit 1e9a058
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ platform: Any CPU

cache:
- src\packages -> **\packages.config
- vendor/bundle --> Gemfile.lock
- vendor\ -> Gemfile.lock

build:
parallel: true
Expand Down
4 changes: 2 additions & 2 deletions build/funcs/Create-Package.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
$repo = $env:APPVEYOR_REPO_NAME

function Get-GitHubRepo([string]$uri="") {
$finalUri = "https://api.github.com/repos/$repo/$uri?access_token=$($env:GITHUB_TOKEN)"
if ($uri -ne "" && -not $uri.StartsWith("/"){ $uri = "/$uri" }
$finalUri = "https://api.github.com/repos/$repo$uri?access_token=$($env:GITHUB_TOKEN)"
Invoke-WebRequest -Uri $finalUri | ConvertFrom-Json
}

Expand All @@ -12,7 +13,6 @@ $nuspecPath = "$($env:APPVEYOR_BUILD_FOLDER)\$($env:SEB_PROJECT_NAME).nuspec"
$nuspec = [xml](Get-Content $nuspecPath)

if ($env:APPVEYOR_REPO_TAG -eq $true) {
$releaseUri = "https://api.github.com/repos/$($env:APPVEYOR_REPO_NAME)/releases/tags/$($env:APPVEYOR_REPO_TAG_NAME)?access_token=$($env:GITHUB_TOKEN)"
$releaseNotes = Get-GitHubRepo("releases/tags/$($env:APPVEYOR_REPO_TAG_NAME)").body.Replace('"','\"').Replace('### ', '')
echo "Release notes: $releaseNotes"
$nuspec.package.metadata.releaseNotes = $releaseNotes
Expand Down
2 changes: 1 addition & 1 deletion build/funcs/Set-Version.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $build = $env:APPVEYOR_BUILD_NUMBER | % PadLeft 4 '0'
$major = $version.Major
$branch = $env:APPVEYOR_REPO_BRANCH

if ($env:APPVEYOR_REPO_TAG){
if ($env:APPVEYOR_REPO_TAG) {
$version = $env:APPVEYOR_REPO_TAG_NAME
} else {
$buildsForBranch = "/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=4000&branch=$branch"
Expand Down

0 comments on commit 1e9a058

Please sign in to comment.