Skip to content

Commit

Permalink
Initial checkin
Browse files Browse the repository at this point in the history
Based on a PoC done in phly/keep-a-changelog.

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
  • Loading branch information
weierophinney committed Feb 4, 2021
0 parents commit 798e140
Show file tree
Hide file tree
Showing 90 changed files with 5,355 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/actions/generate-tags/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: 'Create major/minor tags'
description: 'Create a list of major and minor versions to tag from the current tag.'
outputs:
original-tag:
description: 'Original tag name'
tags:
description: 'Multiline string with tag names to create, one per line.'

runs:
using: 'node12'
main: 'index.js'
16 changes: 16 additions & 0 deletions .github/actions/generate-tags/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const core = require('@actions/core');
const semver = require('semver')

let tagRef = core.getInput('tag-ref');
let tag = tagRef.split('/').pop();

let major = semver.major(tag);
let minor = major + '.' + semver.minor(tag);

let tags = [
'v' + major,
'v' + minor,

This comment has been minimized.

Copy link
@glensc

glensc Feb 4, 2021

sholdn't this be 'v' + major + '.' + minor?

This comment has been minimized.

Copy link
@glensc

glensc Feb 4, 2021

ah, wait, you include "major" to "minor" on line 8.

confusion justified as the variable name would indicate a component not full version. currently I don't have a suggestion on how to name things better

This comment has been minimized.

Copy link
@glensc

glensc Feb 4, 2021

perhaps drop the intermediate variables (as they are not used anywhere):

let tags = [
    `v${semver.major(tag)}`,
    `v${semver.major(tag)}.${semver. minor(tag)}`,
];
];

core.info(`Tags: ${JSON.stringify(tags)}`);
core.setOutput('tags', tags.join("\n"));
1 change: 1 addition & 0 deletions .github/actions/generate-tags/node_modules/.bin/semver

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions .github/actions/generate-tags/node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

147 changes: 147 additions & 0 deletions .github/actions/generate-tags/node_modules/@actions/core/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 798e140

Please sign in to comment.