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

Release Drafter: Automatically replace GitHub handles with names and links #2777

Merged
merged 10 commits into from
Oct 31, 2023

Conversation

seisman
Copy link
Member

@seisman seisman commented Oct 30, 2023

Description of proposed changes

Closes #2775.

The replacers almost works, but it has some trouble with newlines \n.

In my own fork, the draft release (https://github.com/seisman/pygmt/releases, but it's likely you can't see a draft release) looks like this:
image

@seisman seisman added the maintenance Boring but important stuff for the core devs label Oct 30, 2023
@seisman seisman added this to the 0.11.0 milestone Oct 30, 2023
@@ -27,6 +27,19 @@ exclude-contributors:
category-template: '### $TITLE'
change-template: '* $TITLE ([#$NUMBER]($URL))'
sort-by: 'title'
replacers:
- search: '/@(\w+)(,\s| and )?/g'
replace: '- [@$1](https://github.com/$1)\\n'
Copy link
Member

Choose a reason for hiding this comment

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

This is probably more for my understanding: Why are there now two backslashes (\\) before the n? In comment #2775 (comment) it was only one backslash (\).

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 first tried \n, then found it didn't work, then tried \\n, still no luck.

.github/release-drafter.yml Outdated Show resolved Hide resolved
.github/release-drafter.yml Outdated Show resolved Hide resolved
@seisman
Copy link
Member Author

seisman commented Oct 31, 2023

  - search: '/@(\w+)(,\s| and )?/g'
    replace: '- [@$1](https://github.com/$1)\n'

The above regex produces the following output:

image

It's likely because Markdown doesn't support \n. There may be some workarounds but I don't think it is worth my time.

In commit 4f8236a, I've changed the regex to

  - search: '/@(\w+)?/g'
    replace: '[@$1](https://github.com/$1)'

The new regex produces:
image

It looks good to me. When making a new release, we just need to convert it to a bulleted list and sort the names based on number of commits.

@seisman seisman marked this pull request as ready for review October 31, 2023 06:40
@seisman seisman added the needs review This PR has higher priority and needs review. label Oct 31, 2023
@michaelgrund michaelgrund added final review call This PR requires final review and approval from a second reviewer and removed needs review This PR has higher priority and needs review. labels Oct 31, 2023
.github/release-drafter.yml Outdated Show resolved Hide resolved
.github/release-drafter.yml Outdated Show resolved Hide resolved
seisman and others added 2 commits October 31, 2023 17:20
Co-authored-by: Yvonne Fröhlich <[email protected]>
Co-authored-by: Yvonne Fröhlich <[email protected]>
Comment on lines +33 to +38
- search: '@maxrjones'
replace: 'Max Jones'
- search: '@michaelgrund'
replace: 'Michael Grund'
- search: '@seisman'
replace: 'Dongdong Tian'
Copy link
Member

Choose a reason for hiding this comment

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

Sort this part alphabetically?

Copy link
Member Author

Choose a reason for hiding this comment

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

They're already sorted alphabetically by GitHub handles, no?

Copy link
Member

Choose a reason for hiding this comment

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

Oh right, was looking at full names, nvm.

@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Oct 31, 2023
@seisman seisman merged commit dfe2554 into GenericMappingTools:main Oct 31, 2023
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Boring but important stuff for the core devs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Release Drafter: Automatically replace GitHub handles with real names and links
4 participants