-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0335c16
commit d1c5af2
Showing
4 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: Fetch PRs | ||
description: Fetch PRs from the Kibana repository and update the release notes draft | ||
inputs: | ||
target-repo: | ||
description: 'elastic/kibana' | ||
required: true | ||
default: 'elastic/kibana' | ||
runs: | ||
using: 'node12' | ||
main: 'index.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const core = require('@actions/core'); | ||
const github = require('@actions/github'); | ||
const fs = require('fs'); | ||
|
||
async function run() { | ||
try { | ||
const targetRepo = core.getInput('elastic/kibana'); | ||
const [owner, repo] = targetRepo.split('/'); | ||
const octokit = github.getOctokit(process.env.GITHUB_TOKEN); | ||
|
||
const { data: pulls } = await octokit.pulls.list({ | ||
owner, | ||
repo, | ||
state: 'closed', | ||
}); | ||
|
||
let releaseNotes = '## Changes from ' + targetRepo + '\n\n'; | ||
for (const pr of pulls) { | ||
if (pr.merged_at) { | ||
releaseNotes += `- ${pr.title} (#${pr.number}) by @${pr.user.login}\n`; | ||
} | ||
} | ||
|
||
fs.writeFileSync('release-notes.asciidoc', releaseNotes); | ||
core.setOutput('release-notes', releaseNotes); | ||
} catch (error) { | ||
core.setFailed(error.message); | ||
} | ||
} | ||
|
||
run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name-template: 'v$NEXT_PATCH_VERSION' | ||
tag-template: 'v$NEXT_PATCH_VERSION' | ||
change-template: '* $TITLE ({$URL[#$NUMBER])' | ||
exclude-labels: | ||
- 'release_note:skip' | ||
- 'Team:Docs' | ||
- 'reverted' | ||
- 'backport' | ||
include-labels: | ||
- 'Feature:Uptime' | ||
- 'Feature:Logs UI' | ||
- 'Team:apm' | ||
- 'Team:APM' | ||
- 'Feature:Metrics UI' | ||
- 'Team:logs-metrics-ui' | ||
- 'Feature:Observability Home' | ||
- 'Team:obs-ux-management' | ||
- 'Team:Obs AI Assistant' | ||
- 'Feature:SLO' | ||
categories: | ||
- title: 'Breaking changes' | ||
collapse-after: 5 | ||
labels: ['release_note:breaking'] | ||
- title: 'Features and enhancements' | ||
collapse-after: 5 | ||
labels: ['release_note:feature', 'release_note:enhancement'] | ||
- title: 'Bug fixes' | ||
collapse-after: 5 | ||
labels: ['release_note:fix'] | ||
template: | | ||
== Elastic {observability} | ||
$CHANGES | ||
To view all changes, check https://github.com/$OWNER/$REPO/compare/$PREVIOUS_TAG...$CURRENT_TAG. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Release notes drafter | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [ closed ] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
update_release_draft: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Fetch PRs from another repository | ||
id: fetch_prs | ||
uses: ./.github/actions/fetch-prs | ||
with: | ||
target-repo: 'elastic/kibana' | ||
|
||
- name: Run release notes drafter | ||
id: drafter | ||
uses: release-drafter/release-drafter@v5 | ||
with: | ||
config-name: release-drafter.yml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Update release notes | ||
run: echo "${{ steps.fetch_prs.outputs.release-notes }}" >> release-notes.asciidoc | ||
|
||
- name: Create release | ||
uses: actions/create-release@v1 | ||
with: | ||
tag_name: ${{ github.event.release.tag_name }} | ||
release_name: ${{ github.event.release.tag_name }} | ||
body_path: release-notes.asciidoc | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |