-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix release notes diff in github release actions #1882
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
base: main
Are you sure you want to change the base?
Changes from 7 commits
338729b
eee55d3
31ccd27
628585f
7814ee9
5b68b5b
cd8c537
61f89a9
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 |
|---|---|---|
|
|
@@ -23,11 +23,12 @@ jobs: | |
| steps: | ||
| - name: "Create release output" | ||
| run: echo '🎬 Release process for version ${{ env.RELEASE_VERSION }} started by @${{ github.triggering_actor }}' >> $GITHUB_STEP_SUMMARY | ||
|
|
||
| - uses: mongodb-labs/drivers-github-tools/secure-checkout@v2 | ||
| with: | ||
| app_id: ${{ vars.APP_ID }} | ||
| private_key: ${{ secrets.APP_PRIVATE_KEY }} | ||
| fetch-depth: 0 | ||
|
Member
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. What does this do? I think
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. @rozza yes fetch-depth 0 fetches all branches and tags. Per the GitHub Actions documentation (https://docs.github.com/en/actions/tutorials/create-an-example-workflow), drivers-github-tools is only pulled internally to run the action itself. The checkout operates on github.ref. |
||
|
|
||
| - name: "Store version numbers in env variables" | ||
| # The awk command to increase the version number was copied from | ||
|
|
@@ -43,6 +44,11 @@ jobs: | |
| # Example: 5.2.0 => 5.2.x | ||
| # Example: 5.2.0-beta1 => <current branch> | ||
| run: | | ||
| echo CURRENT_TAG=$(git \ | ||
|
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. this git command is somewhat complex. what it does - a) get all tags b) teaches git that those suffixes make a version lower than just the minor/major version c) get the first one in the list (which is the most current tag) |
||
| -c versionsort.suffix=-alpha \ | ||
| -c versionsort.suffix=-beta \ | ||
| -c versionsort.suffix=-rc \ | ||
| tag --list 'r*' --sort=-v:refname | head -n 1) >> $GITHUB_ENV | ||
| echo RELEASE_VERSION=${{ inputs.version }} >> $GITHUB_ENV | ||
| echo RELEASE_VERSION_WITHOUT_SUFFIX=$(echo ${{ inputs.version }} | awk -F- '{print $1}') >> $GITHUB_ENV | ||
| if [[ "${{ inputs.version }}" =~ (alpha|beta|rc)[0-9]+$ ]]; then | ||
|
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.
🌟 Fixed in commit 61f89a9 🌟 |
||
|
|
@@ -130,6 +136,7 @@ jobs: | |
| --target ${{ env.RELEASE_BRANCH }} \ | ||
| --title "Java Driver ${{ env.RELEASE_VERSION }} ($(date '+%B %d, %Y'))" \ | ||
| --generate-notes \ | ||
| --notes-start-tag "${{ env.CURRENT_TAG }}" \ | ||
| --draft\ | ||
| )" >> "$GITHUB_ENV" | ||
|
|
||
|
|
||
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.
Have we tested this in the fork yet? I also noticed the note: "Needs to be tested by triggering GitHub Actions manually before merging.”
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.
@vbabanin tested finally - https://github.com/atandon2024/mongo-java-driver/releases/tag/untagged-d68ec2c3f4e63cb2b5e0