-
Notifications
You must be signed in to change notification settings - Fork 0
Implement draft release #57
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 | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,7 @@ | ||||||||||||||||||||||||||||||||||||||||
| # Placeholder draft-release workflow | ||||||||||||||||||||||||||||||||||||||||
| # Drafts new mailtrap-java release: bumps the version in pom.xml, regenerates the changelog | ||||||||||||||||||||||||||||||||||||||||
| # from merged PRs, and opens a release PR against main. | ||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||
| name: Draft java Release | ||||||||||||||||||||||||||||||||||||||||
| name: Draft Java Release | ||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||||||||||
| inputs: | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -14,14 +15,75 @@ on: | |||||||||||||||||||||||||||||||||||||||
| - major | ||||||||||||||||||||||||||||||||||||||||
| default: patch | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| concurrency: | ||||||||||||||||||||||||||||||||||||||||
| group: ${{ github.workflow }} | ||||||||||||||||||||||||||||||||||||||||
| cancel-in-progress: false | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||
| contents: write | ||||||||||||||||||||||||||||||||||||||||
| pull-requests: write | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||
| draft-release: | ||||||||||||||||||||||||||||||||||||||||
| name: Draft java Release (placeholder) | ||||||||||||||||||||||||||||||||||||||||
| name: Draft mailtrap-java Release | ||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||
| - name: Echo inputs | ||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||
| BUMP_TYPE: ${{ inputs.bump_type }} | ||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||
| echo "Placeholder draft-release workflow" | ||||||||||||||||||||||||||||||||||||||||
| echo "bump_type=$BUMP_TYPE" | ||||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||
| ref: main | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - name: Set up JDK | ||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-java@v4 | ||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||
| java-version: '17' | ||||||||||||||||||||||||||||||||||||||||
| distribution: 'temurin' | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - name: Read current version | ||||||||||||||||||||||||||||||||||||||||
| id: read | ||||||||||||||||||||||||||||||||||||||||
| run: echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> "$GITHUB_OUTPUT" | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - name: Compute next version | ||||||||||||||||||||||||||||||||||||||||
| id: bump | ||||||||||||||||||||||||||||||||||||||||
| uses: railsware/github-actions/compute-next-semver@master | ||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||
| current: ${{ steps.read.outputs.version }} | ||||||||||||||||||||||||||||||||||||||||
| bump-type: ${{ inputs.bump_type }} | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - name: Abort if tag already exists | ||||||||||||||||||||||||||||||||||||||||
| uses: railsware/github-actions/abort-if-tag-exists@master | ||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||
| tag: ${{ steps.bump.outputs.tag }} | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - name: Generate release notes | ||||||||||||||||||||||||||||||||||||||||
| id: notes | ||||||||||||||||||||||||||||||||||||||||
| uses: railsware/github-actions/generate-release-notes@master | ||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||
| tag: ${{ steps.bump.outputs.tag }} | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - name: Bump version in pom.xml | ||||||||||||||||||||||||||||||||||||||||
| if: steps.notes.outputs.release_notes != '' | ||||||||||||||||||||||||||||||||||||||||
| run: mvn versions:set -DnewVersion=${{ steps.bump.outputs.next }} -DgenerateBackupPoms=false | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+63
to
+65
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. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win Prevent shell injection via environment variable on the Maven version bump.
🔒️ Proposed fix - name: Bump version in pom.xml
if: steps.notes.outputs.release_notes != ''
+ env:
+ NEXT_VERSION: ${{ steps.bump.outputs.next }}
- run: mvn versions:set -DnewVersion=${{ steps.bump.outputs.next }} -DgenerateBackupPoms=false
+ run: mvn versions:set -DnewVersion="$NEXT_VERSION" -DgenerateBackupPoms=false📝 Committable suggestion
Suggested change
🧰 Tools🪛 zizmor (1.26.1)[info] 65-65: code injection via template expansion (template-injection): may expand into attacker-controllable code (template-injection) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - name: Prepend new section to CHANGELOG.md | ||||||||||||||||||||||||||||||||||||||||
| if: steps.notes.outputs.release_notes != '' | ||||||||||||||||||||||||||||||||||||||||
| uses: railsware/github-actions/prepend-changelog@master | ||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||
| version: ${{ steps.bump.outputs.next }} | ||||||||||||||||||||||||||||||||||||||||
| release-notes: ${{ steps.notes.outputs.release_notes }} | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+67
to
+72
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. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win Handle missing The pipeline failed with 🐛 Proposed fix - name: Ensure CHANGELOG.md exists
+ if: steps.notes.outputs.release_notes != ''
+ run: |
+ if [ ! -f CHANGELOG.md ]; then
+ touch CHANGELOG.md
+ fi
+
- name: Prepend new section to CHANGELOG.md
if: steps.notes.outputs.release_notes != ''
uses: railsware/github-actions/prepend-changelog@master📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsSource: Pipeline failures |
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - name: Commit, push, open PR | ||||||||||||||||||||||||||||||||||||||||
| if: steps.notes.outputs.release_notes != '' | ||||||||||||||||||||||||||||||||||||||||
| uses: railsware/github-actions/open-sdk-release-pr@master | ||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||
| tag: ${{ steps.bump.outputs.tag }} | ||||||||||||||||||||||||||||||||||||||||
| current: ${{ steps.read.outputs.version }} | ||||||||||||||||||||||||||||||||||||||||
| next: ${{ steps.bump.outputs.next }} | ||||||||||||||||||||||||||||||||||||||||
| bump-type: ${{ inputs.bump_type }} | ||||||||||||||||||||||||||||||||||||||||
| release-notes: ${{ steps.notes.outputs.release_notes }} | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - name: Create draft GitHub release | ||||||||||||||||||||||||||||||||||||||||
| if: steps.notes.outputs.release_notes != '' | ||||||||||||||||||||||||||||||||||||||||
| uses: railsware/github-actions/create-draft-github-release@master | ||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||
| tag: ${{ steps.bump.outputs.tag }} | ||||||||||||||||||||||||||||||||||||||||
| release-notes: ${{ steps.notes.outputs.release_notes }} | ||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| ## [1.3.0] - 2026-05-14 | ||
|
|
||
| See https://github.com/mailtrap/mailtrap-java/releases/tag/v1.3.0 | ||
|
|
||
| ## [1.2.0] - 2026-03-23 | ||
|
|
||
| See https://github.com/mailtrap/mailtrap-java/releases/tag/v1.2.0 | ||
|
|
||
| ## [1.1.0] - 2025-10-24 | ||
|
|
||
| See https://github.com/mailtrap/mailtrap-java/releases/tag/v1.1.0 | ||
|
|
||
| ## [1.0.0] - 2025-02-19 | ||
|
|
||
| See https://github.com/mailtrap/mailtrap-java/releases/tag/v1.0.0 |
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.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: mailtrap/mailtrap-java
Length of output: 583
🏁 Script executed:
Repository: mailtrap/mailtrap-java
Length of output: 217
🏁 Script executed:
Repository: mailtrap/mailtrap-java
Length of output: 2825
Pin all
railsware/github-actionssteps to commit SHAs. The six release steps still use mutable@masterrefs, so a compromise of that repo could run arbitrary code here with write permissions.🤖 Prompt for AI Agents
Source: Linters/SAST tools