Hi have the following release task set up for github org release,
- task: GitHubRelease@1
inputs:
gitHubConnection: '(GH) Prod-RW-Releases'
repositoryName: 'Azure/testrepository'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: 'v1.0.2-prerelease'
title: 'v$(Build.BuildNumber)'
assets: '$(REPOROOT)/src/**'
addChangeLog: false
isPreRelease: true
I have the repository in azure devops pipeline, no matter whatever i try i keep getting 422 error for one reason or another.
-
Tag_Name is not valid, so many times this issue came up, finally i was able to resolve it by creating a release and tagging it with a tagname and gave same tagname to my build pipeline. But somehow i feel there can be a better way to do this thing. I am not even sure if i am doing the right thing.
-
This is the current error message which i am hustling with right now. {“message”:”Validation Failed”,”errors”:[{“resource”:”Release”,”code”:”invalid”,”field”:”target_commitish”}],”documentation_url”:”https://docs.github.com/rest/releases/releases#create-a-release”,”status”:”422″}}
We have an urgent GA release, need to do a global publish for our tools.
Worst case plan B is to move all the code to GitHub repository and take things from there.
7
Based on the update, we discussed the relationship between your GitHub repository and the Azure Repo where the .yml pipeline definition file resided. For further investigation, I imported the code from my GitHub testrepository
into Azure Repos and created a pipeline with GitHubRelease@1
task. The issue could be still reproduced if there was no corresponding commit SHA (target: '$(Build.SourceVersion)'
) in the target GitHub repo. This appears to be the expected behavior when there is no matching commit SHA, as the pipeline attempts to create a Git tag for the GitHub repo.
Azure DevOps supports pipelines that reference definition files from a GitHub repository. I recommend using this method to create GitHub tags and releases directly from your pipeline. Given that there is no shared commit history between your GitHub repository and Azure Repo, performing a force push to the GitHub repository is not advisable.
7