From 857f95f61486e21d5a27d27f9e30129eaf8b069c Mon Sep 17 00:00:00 2001 From: galargh Date: Fri, 24 Mar 2023 12:34:13 +0100 Subject: [PATCH] feat: include all the tags in outputs --- CHANGELOG.md | 4 ++++ README.md | 5 +++-- action.yml | 2 ++ index.js | 9 +++++---- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05b4227..e243759 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## [1.0.4] - 2023-03-24 +### Added +- tags output which contains all the created tags + ## [1.0.3] - 2023-03-01 ### Fixed - subtags should be updated when the GitHub release is published diff --git a/README.md b/README.md index 54c4cc7..60306c2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Changelog Driven Release -Changelog Driven Release is a GitHub Action that automates the release process for GitHub Actions based on changes to a changelog file that follows [keep a changelog](https://keepachangelog.com/en/1.0.0/) guidelines. +Changelog Driven Release is a GitHub Action that automates the release process for GitHub Actions based on changes to a changelog file that follows [keep a changelog](https://keepachangelog.com/en/1.0.0/) guidelines. ## Usage @@ -26,6 +26,7 @@ To use the action, add the following step to your GitHub Actions workflow: * `url`: The URL of the created release. * `tag`: The main tag of the release. +* `tags`: The tags of the release. * `body`: The description the release was created with. ## How it works @@ -37,6 +38,6 @@ When run, the action looks for the top-most release section in the changelog fil The action supports both prerelease and build version suffixes. If the action is run in draft mode, the release will be a draft release. Otherwise, it will be a published release, with the tag automatically created. ## Example -This action is used to release itself. Here's an example release PR: https://github.com/pl-strflt/changelog-driven-release/pull/4. You can see the release workflow [here](https://github.com/pl-strflt/changelog-driven-release/blob/main/.github/workflows/release.yml) and the changelog that it uses [here](https://github.com/pl-strflt/changelog-driven-release/blob/main/CHANGELOG.md). +This action is used to release itself. Here's an example release PR: https://github.com/pl-strflt/changelog-driven-release/pull/4. You can see the release workflow [here](https://github.com/pl-strflt/changelog-driven-release/blob/main/.github/workflows/release.yml) and the changelog that it uses [here](https://github.com/pl-strflt/changelog-driven-release/blob/main/CHANGELOG.md). --- diff --git a/action.yml b/action.yml index 53dc790..7df4c6a 100644 --- a/action.yml +++ b/action.yml @@ -21,6 +21,8 @@ outputs: description: 'The URL of the release' tag: description: 'The tag of the release' + tags: + description: 'The tags of the release' body: description: 'The body of the release' runs: diff --git a/index.js b/index.js index c08c7d9..9429505 100644 --- a/index.js +++ b/index.js @@ -102,13 +102,12 @@ async function run() { } core.info(`Release: ${release.html_url}`) + const tags = [] if (release.published_at != null) { core.info('Updating mutable tags...') const suffix = `${version[4] != null ? '-' + version[4] : ''}${version[5] != null ? '+' + version[5] : ''}` - const tags = [ - `v${version[1]}.${version[2]}${suffix}`, - `v${version[1]}${suffix}` - ] + tags.push(`v${version[1]}.${version[2]}${suffix}`) + tags.push(`v${version[1]}${suffix}`) for (const tag of tags) { core.info(`Tag: ${tag}`) core.info('Listing refs...') @@ -135,9 +134,11 @@ async function run() { } } } + tags.push(tag) core.setOutput("url", release.html_url) core.setOutput("tag", tag) + core.setOutput("tags", tags.join(',')) core.setOutput("body", body) } catch (error) { core.setFailed(error.message)