Skip to content

Commit

Permalink
feat: include all the tags in outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
galargh committed Mar 24, 2023
1 parent aa41eb5 commit 857f95f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand All @@ -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).

---
2 changes: 2 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 5 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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...')
Expand All @@ -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)
Expand Down

0 comments on commit 857f95f

Please sign in to comment.