Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added outputs #66

Merged
merged 8 commits into from
Apr 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading