Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
feat: output DNS compatible version
Browse files Browse the repository at this point in the history
  • Loading branch information
Saghen committed Jul 5, 2023
1 parent 63a0ed1 commit 8485dcb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ inputs:
token:
description: 'GitHub token'
outputs:
version_dns:
description: 'New version in the DNS compatible format of vMAJOR-YYYMMDD-PATCH'
version:
description: 'New version in the format of vMAJOR.YYYMMDD.PATCH'
major:
Expand Down
2 changes: 2 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13066,6 +13066,7 @@ async function run() {
const patch = level !== 'major' && currentVersion.minor === minorVersion ? currentVersion.patch + 1 : 0
const newVersionParts = [major, minor, patch]
const newVersion = `v${newVersionParts.join('.')}`
const newVersionDNS = `v${newVersionParts.join('-')}`

// Commit the tag to the repo
const newTag = await octokit.rest.git.createTag({
Expand All @@ -13083,6 +13084,7 @@ async function run() {
core.info(`Tag "${newVersion}" created on commit SHA "${process.env.GITHUB_SHA}"`)
core.notice(`New version: ${newVersion}`)

core.setOutput('version_dns', newVersionDNS)
core.setOutput('version', newVersion)
core.setOutput('major', major)
core.setOutput('minor', minor)
Expand Down
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ async function run() {
const patch = level !== 'major' && currentVersion.minor === minorVersion ? currentVersion.patch + 1 : 0
const newVersionParts = [major, minor, patch]
const newVersion = `v${newVersionParts.join('.')}`
const newVersionDNS = `v${newVersionParts.join('-')}`

// Commit the tag to the repo
const newTag = await octokit.rest.git.createTag({
Expand All @@ -54,6 +55,7 @@ async function run() {
core.info(`Tag "${newVersion}" created on commit SHA "${process.env.GITHUB_SHA}"`)
core.notice(`New version: ${newVersion}`)

core.setOutput('version_dns', newVersionDNS)
core.setOutput('version', newVersion)
core.setOutput('major', major)
core.setOutput('minor', minor)
Expand Down

0 comments on commit 8485dcb

Please sign in to comment.