-
Notifications
You must be signed in to change notification settings - Fork 2.8k
ci: automatically tag contributors in GitHub release notes #10074
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,6 @@ on: | |
| - "v2.[0-9]+.[0-9]+*" | ||
| # Ignore release versions tagged with -rc0 suffix | ||
| - "!v2.[0-9]+.[0-9]-rc0" | ||
|
|
||
| jobs: | ||
| generate-notes: | ||
| runs-on: ubuntu-latest | ||
|
|
@@ -59,16 +58,45 @@ jobs: | |
| reno report --no-show-source --ignore-cache --version v${{ steps.version.outputs.current_release }} -o relnotes.rst | ||
|
|
||
| - name: Convert to Markdown | ||
| uses: docker://pandoc/core:3.1 | ||
| uses: docker://pandoc/core:3.8 | ||
| with: | ||
| args: "--from rst --to markdown_github --no-highlight relnotes.rst -o relnotes.md --wrap=none" | ||
| args: "--from rst --to gfm --syntax-highlighting=none --wrap=none relnotes.rst -o relnotes.md" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here we can also do something like: to save the copy step below. Your choice!
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, unfortunately pandoc creates a markdown files that cannot be later modified (wrong permissions).
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, let's then leave things as is (since it's working). I would add a comment about that, maybe next time we could try to investigate better.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense. Comment added in 719219a |
||
|
|
||
| # We copy the relnotes file since the original one cannot be modified due to permissions | ||
| - name: Copy relnotes file | ||
| run: | | ||
| cat relnotes.md > enhanced_relnotes.md | ||
|
|
||
| - name: Add contributor list | ||
| # only for minor releases and minor release candidates (not bugfix releases) | ||
| if: endsWith(steps.version.outputs.current_release, '.0') | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| START: v${{ steps.version.outputs.current_release }}-rc0 | ||
| END: ${{ github.ref_name }} | ||
| run: | | ||
| JQ_EXPR='[.commits[].author.login] | ||
| | map(select(. != null and . != "HaystackBot" and . != "dependabot[bot]")) | ||
| | unique | ||
| | sort_by(ascii_downcase) | ||
| | map("@\(.)") | ||
| | join(", ")' | ||
| CONTRIBUTORS=$(gh api "repos/deepset-ai/haystack/compare/$START...$END" \ | ||
|
mpangrazzi marked this conversation as resolved.
|
||
| --jq "$JQ_EXPR") || { echo "Unable to fetch contributors"; exit 1; } | ||
|
|
||
| { | ||
| echo "" | ||
| echo "## 💙 Big thank you to everyone who contributed to this release!" | ||
| echo "" | ||
| echo "$CONTRIBUTORS" | ||
| } >> enhanced_relnotes.md | ||
|
|
||
| - name: Debug | ||
| run: | | ||
| cat relnotes.md | ||
| cat enhanced_relnotes.md | ||
|
|
||
| - uses: ncipollo/release-action@v1 | ||
| with: | ||
| bodyFile: "relnotes.md" | ||
| prerelease: ${{ steps.version.outputs.current_pre_release }} | ||
| bodyFile: "enhanced_relnotes.md" | ||
| prerelease: ${{ steps.version.outputs.current_pre_release != '' }} | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| allowUpdates: true | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some arguments were deprecated