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

chore: add last version changelog to the GitHub release #946

Merged
merged 1 commit into from
Nov 17, 2023

Conversation

lemeurherve
Copy link
Member

@lemeurherve lemeurherve commented Nov 17, 2023

What does this PR do?

This PR add the last version changelog to the GitHub release body when a new chart version is published.

Tested on a fork, result:

image

@lemeurherve lemeurherve requested a review from a team as a code owner November 17, 2023 17:04
@@ -25,6 +25,76 @@ jobs:
version: v3.12.0

- name: Run chart-releaser
uses: helm/[email protected]
id: chart_releaser
uses: helm/[email protected]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumped to https://github.com/helm/chart-releaser-action/releases/tag/v1.6.0 to retrieve the new changed_charts output.

Comment on lines +34 to +43
- name: Checkout
if: steps.chart_releaser.outputs.changed_charts != ''
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get Last Tag
id: last_tag
if: steps.chart_releaser.outputs.changed_charts != ''
run: echo "tag=$(git describe --abbrev=0 --tags)" >> "${GITHUB_OUTPUT}"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, the new chart_version returned by helm/[email protected] is the last chart version before the publication of the current one, we need a checkout to retrieve the tag created by chart-releaser.

release_id: process.env.ID,
owner: context.repo.owner,
repo: context.repo.repo,
body: process.env.BODY.slice(1, -1) + "\r\n\r\n## Changelog" + process.env.CHANGELOG,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the slice here to get rid of the double quotes around the release body.
I haven't found where they come from.

@lemeurherve lemeurherve requested a review from a team as a code owner November 17, 2023 18:15
@lemeurherve lemeurherve force-pushed the add-changelog-to-gh-release branch from 8c456cf to 6baee18 Compare November 17, 2023 18:22
Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, next level would be something like this:
https://blog.artifacthub.io/blog/changelogs/

@timja timja merged commit a052ad9 into jenkinsci:main Nov 17, 2023
5 checks passed
@lemeurherve lemeurherve deleted the add-changelog-to-gh-release branch November 18, 2023 09:17
@lemeurherve
Copy link
Member Author

nice, next level would be something like this: https://blog.artifacthub.io/blog/changelogs/

Implemented in #949

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 this pull request may close these issues.

2 participants