Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .eslintrc.json

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
pull_request:
types:
- closed
- opened

name: Release

Expand Down
34 changes: 28 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
```

## Example: Prefill release summary
## Example: Prefill release summary and version increment

Using the `pull_numbers_in_release` output and dry run mode, you can prefill the PR body with the release summary depending on your PR template.

Expand All @@ -136,6 +136,12 @@ xxx

xxx

## This pull request is a

- [ ] Patch change
- [ ] Minor change
- [ ] Major change

## Screenshots (if appropriate)

xxx
Expand Down Expand Up @@ -181,11 +187,26 @@ jobs:
match = match?.split('\n').map(s => s.trim()).filter(Boolean).map(
s => s.startsWith('-') || s.startsWith('*') ? s : `* ${s}`
).join('\n');
return `${pr.data.title}\n${match}`;

let type = 0 // patch
if (body.includes("[x] Major")) {
type = 2 // major
} else if (body.includes("[x] Minor")) {
type = 1 // minor
}

return {
summary: `${pr.data.title}\n${match}`,
type,
}
})).then((prs) => prs.filter(Boolean));
const releaseSummary = mergedPrs.join('\n\n');
return resultSummary;
result-encoding: string

const releaseSummary = mergedPrs.map((pr) => pr.summary).join('\n\n');
core.setOutput('release_summary', releaseSummary);

const versionIncrementType = Math.max(...mergedPrs.map((pr) => pr.type));
const versionIncrement = ['patch', 'minor', 'major'][versionIncrementType] || 'patch';
core.setOutput('version_increment', versionIncrement);

- id: release_workflow
name: gitflow-workflow-action release workflows
Expand All @@ -194,7 +215,8 @@ jobs:
develop_branch: "develop"
main_branch: "main"
version: ${{ inputs.version }}
release_summary: ${{ steps.generate_pr_summary.outputs.result }}
release_summary: ${{ steps.generate_pr_summary.outputs.release_summary }}
version_increment: ${{ steps.generate_pr_summary.outputs.version_increment }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
Expand Down
Loading
Loading