mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-01-18 05:18:24 +02:00
Ensure asset update for latest release only
This commit is contained in:
parent
319066acf2
commit
5c87d4775c
@ -58,7 +58,8 @@ func runGithubPublishRelease(ctx context.Context, myGithubPublishReleaseOptions
|
||||
publishedAt = lastRelease.GetPublishedAt()
|
||||
log.Entry().Debugf("Previous GitHub release published: '%v'", publishedAt)
|
||||
|
||||
if myGithubPublishReleaseOptions.UpdateAsset {
|
||||
//updating assets only supported on latest release
|
||||
if myGithubPublishReleaseOptions.UpdateAsset && myGithubPublishReleaseOptions.Version == "latest" {
|
||||
return uploadReleaseAsset(ctx, lastRelease.GetID(), myGithubPublishReleaseOptions, ghRepoClient)
|
||||
}
|
||||
|
||||
|
@ -171,6 +171,7 @@ func TestRunGithubPublishRelease(t *testing.T) {
|
||||
myGithubPublishReleaseOptions := githubPublishReleaseOptions{
|
||||
UpdateAsset: true,
|
||||
AssetPath: filepath.Join("testdata", t.Name()+"_test.txt"),
|
||||
Version: "latest",
|
||||
}
|
||||
|
||||
err := runGithubPublishRelease(ctx, &myGithubPublishReleaseOptions, &ghRepoClient, &ghIssueClient)
|
||||
|
Loading…
x
Reference in New Issue
Block a user