Skip to content

Commit 6d9d741

Browse files
author
Stan van Rooy
committed
init action
1 parent dc3b2bc commit 6d9d741

File tree

7 files changed

+10241
-0
lines changed

7 files changed

+10241
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+

LICENSE

Lines changed: 664 additions & 0 deletions
Large diffs are not rendered by default.

dist/LICENSE

Lines changed: 622 additions & 0 deletions
Large diffs are not rendered by default.

dist/index.js

Lines changed: 8485 additions & 0 deletions
Large diffs are not rendered by default.

index.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const core = require('@actions/core');
2+
const github = require('@actions/github');
3+
4+
let octokit = undefined;
5+
6+
const getHeadReleaseTag = async () => {
7+
const response = await octokit.request("GET /repos/{owner}/{repo}/releases/latest", {
8+
owner: github.context.owner,
9+
repo: github.context.repo
10+
});
11+
return response.tag_name;
12+
}
13+
14+
const getDefaultBaseReleaseTag = async () => {
15+
16+
}
17+
18+
(async function() {
19+
try {
20+
const token = core.getInput('token');
21+
octokit = github.getOctokit(token);
22+
const headReleaseTag = getHeadReleaseTag()
23+
const baseReleaseTag = core.getInput('release-tag') || await getDefaultBaseReleaseTag();
24+
25+
const response = await octokit.request("GET /GET /repos/{owner}/{repo}/compare/{base}...{head}", {
26+
head: headReleaseTag,
27+
base: baseReleaseTag
28+
});
29+
const messages = response.commits.map(c => c.commit.message);
30+
core.setOutput('messages', messages.join(' '));
31+
} catch (error) {
32+
core.setFailed(error.message);
33+
}
34+
})()
35+

0 commit comments

Comments
 (0)