Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildDockerAndPublishImage fails at GitHub Release stage if there are more than one "next" draft releases #379

Closed
lemeurherve opened this issue May 14, 2022 · 1 comment · Fixed by #380

Comments

@lemeurherve
Copy link
Member

lemeurherve commented May 14, 2022

final String release = sh(returnStdout: true, script: 'gh api ${GH_RELEASES_API_URI} | jq -e -r \'.[] | select(.draft == true and .name == "next") | .id\'').trim()

Example of failing build :
image

Corresponding releases

image

https://github.com/jenkins-infra/docker-openvpn/releases

@dduportal
Copy link
Contributor

Side note : there is also the case of no « next » release. Usually, adding trigger event « release » on the gh workflow for release drafter fix it. But maybe we could trigger release-drafter here and manage the draft release for ourselves ?

lemeurherve added a commit to jenkins-infra/jenkins-maven-cd-action that referenced this issue May 16, 2022
As noted in jenkins-infra/pipeline-library#379, if there are more than one `next` release drafts, this script fails as it returns a multiline string.
lemeurherve added a commit to jenkins-infra/jenkins-maven-cd-action that referenced this issue May 24, 2022
* fix: retrieve only last `next` release draft

As noted in jenkins-infra/pipeline-library#379, if there are more than one `next` release drafts, this script fails as it returns a multiline string.

* fix: also correct jq expression for INTERESTING_CATEGORIES grep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants