Skip to content

Commit

Permalink
Added outputs (#66)
Browse files Browse the repository at this point in the history
* Added outputs

* Added ouputs

* Test releaser

* Test releaser

* Test releaser

* Remove disable-release input

* Apply suggestions from code review

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* Remove disable-release input

---------

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>
  • Loading branch information
goruha and osterman authored Apr 17, 2024
1 parent 2f3f7e9 commit 9d13e94
Showing 1 changed file with 49 additions and 1 deletion.
50 changes: 49 additions & 1 deletion .github/workflows/shared-auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,60 @@ on:
type: string
required: false
default: '["ubuntu-latest"]'

outputs:
id:
description: The ID of the release that was created or updated.
value: ${{ jobs.release.outputs.id }}
name:
description: The name of the release
value: ${{ jobs.release.outputs.name }}
tag_name:
description: The name of the tag associated with the release.
value: ${{ jobs.release.outputs.tag_name }}
body:
description: The body of the drafted release.
value: ${{ jobs.release.outputs.body }}
html_url:
description: The URL users can navigate to in order to view the release
value: ${{ jobs.release.outputs.html_url }}
upload_url:
description: The URL for uploading assets to the release, which could be used by GitHub Actions for additional uses, for example the @actions/upload-release-asset GitHub Action.
value: ${{ jobs.release.outputs.upload_url }}
major_version:
description: The next major version number. For example, if the last tag or release was v1.2.3, the value would be v2.0.0.
value: ${{ jobs.release.outputs.major_version }}
minor_version:
description: The next minor version number. For example, if the last tag or release was v1.2.3, the value would be v1.3.0.
value: ${{ jobs.release.outputs.minor_version }}
patch_version:
description: The next patch version number. For example, if the last tag or release was v1.2.3, the value would be v1.2.4.
value: ${{ jobs.release.outputs.patch_version }}
resolved_version:
description: The next resolved version number, based on GitHub labels.
value: ${{ jobs.release.outputs.resolved_version }}
exists:
description: Tag exists so skip new release issue
value: ${{ jobs.check-duplicate.outputs.exists }}

permissions: {}

jobs:
release:
runs-on: ${{ fromJSON(inputs.runs-on) }}
environment: release
outputs:
id: ${{ steps.drafter.outputs.id }}
name: ${{ steps.drafter.outputs.name }}
tag_name: ${{ steps.drafter.outputs.tag_name }}
body: ${{ steps.drafter.outputs.body }}
html_url: ${{ steps.drafter.outputs.html_url }}
upload_url: ${{ steps.drafter.outputs.upload_url }}
major_version: ${{ steps.drafter.outputs.major_version }}
minor_version: ${{ steps.drafter.outputs.minor_version }}
patch_version: ${{ steps.drafter.outputs.patch_version }}
resolved_version: ${{ steps.drafter.outputs.resolved_version }}
exists: ${{ steps.drafter.outputs.exists }}

steps:
- uses: actions/create-github-app-token@v1
id: github-app
Expand All @@ -46,6 +93,7 @@ jobs:
# Drafts your next Release notes as Pull Requests are merged into "main"
- uses: cloudposse/github-action-auto-release@v2
id: drafter
with:
token: ${{ steps.github-app.outputs.token }}
publish: ${{ inputs.publish }}
Expand Down

0 comments on commit 9d13e94

Please sign in to comment.