Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
153b3e5c
Commit
153b3e5c
authored
Mar 06, 2019
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated changelog task
parent
72ca51da
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
4 deletions
+31
-4
scripts/cli/index.ts
+9
-1
scripts/cli/tasks/changelog.ts
+22
-3
No files found.
scripts/cli/index.ts
View file @
153b3e5c
...
...
@@ -41,9 +41,17 @@ program
program
.
command
(
'core:changelog'
)
.
option
(
'-m, --milestone <milestone>'
,
'Specify milestone'
)
.
description
(
'Builds changelog markdown'
)
.
action
(
async
cmd
=>
{
await
execTask
(
changelogTask
)({});
if
(
!
cmd
.
milestone
)
{
console
.
log
(
'Please specify milestone, example: --m 6.0.1'
);
return
;
}
await
execTask
(
changelogTask
)({
milestone
:
cmd
.
milestone
,
});
});
program
.
parse
(
process
.
argv
);
...
...
scripts/cli/tasks/changelog.ts
View file @
153b3e5c
...
...
@@ -3,18 +3,37 @@ import axios from 'axios';
const
githubGrafanaUrl
=
'https://github.com/grafana/grafana'
;
interface
ChangelogOptions
{}
interface
ChangelogOptions
{
milestone
:
string
;
}
const
changelogTaskRunner
:
TaskRunner
<
ChangelogOptions
>
=
async
()
=>
{
const
changelogTaskRunner
:
TaskRunner
<
ChangelogOptions
>
=
async
(
{
milestone
}
)
=>
{
let
client
=
axios
.
create
({
baseURL
:
'https://api.github.com/repos/grafana/grafana'
,
timeout
:
10000
,
});
const
res
=
await
client
.
get
(
'/issues?state=closed&labels='
+
encodeURIComponent
(
'add to changelog'
));
const
res
=
await
client
.
get
(
'/issues'
,
{
params
:
{
state
:
'closed'
,
labels
:
'add to changelog'
,
},
});
let
markdown
=
''
;
for
(
const
item
of
res
.
data
)
{
if
(
!
item
.
milestone
)
{
console
.
log
(
'Item missing milestone'
,
item
.
number
);
continue
;
}
// For some reason I could not get the github api to filter on milestone and label
// So doing this filter here
if
(
item
.
milestone
.
title
!==
milestone
)
{
continue
;
}
markdown
+=
'* '
+
item
.
title
+
'.'
;
markdown
+=
` [#
${
item
.
number
}
](
${
githubGrafanaUrl
}
/pull/
${
item
.
number
}
)`
;
markdown
+=
`, [@
${
item
.
user
.
login
}
](
${
item
.
user
.
html_url
}
)`
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment