Merge pull request #36 from mikepenz/feature/additional_output_values
Introduce additional output values
This commit is contained in:
@@ -91,17 +91,11 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Prepare Tag
|
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
|
||||||
id: tag_version
|
|
||||||
run: echo ::set-output name=VERSION::$(echo ${GITHUB_REF:10})
|
|
||||||
|
|
||||||
- name: "Build Changelog"
|
- name: "Build Changelog"
|
||||||
id: github_release
|
id: github_release
|
||||||
uses: mikepenz/release-changelog-builder-action@main
|
uses: mikepenz/release-changelog-builder-action@main
|
||||||
with:
|
with:
|
||||||
configuration: "configs/configuration_repo.json"
|
configuration: "configs/configuration_repo.json"
|
||||||
toTag: ${{ steps.tag_version.outputs.VERSION }}
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ Specify the action as part of your GitHub actions workflow:
|
|||||||
```yml
|
```yml
|
||||||
- name: "Build Changelog"
|
- name: "Build Changelog"
|
||||||
id: build_changelog
|
id: build_changelog
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
|
||||||
uses: mikepenz/release-changelog-builder-action@{latest-release}
|
uses: mikepenz/release-changelog-builder-action@{latest-release}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -61,13 +60,23 @@ By default the action will try to automatically retrieve the `tag` from the curr
|
|||||||
|
|
||||||
### Action outputs
|
### Action outputs
|
||||||
|
|
||||||
The action will succeed and return the `changelog` as a step output. Use it in any follow up step by referencing via its id. For example `build_changelog`.
|
After action execution it will return the `changelog` and additional information as step output. You can use it in any follow up step by referenceing the output by referencing it via the steps id. For example `build_changelog`.
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
# ${{steps.{CHANGELOG_STEP_ID}.outputs.changelog}}
|
# ${{steps.{CHANGELOG_STEP_ID}.outputs.changelog}}
|
||||||
${{steps.build_changelog.outputs.changelog}}
|
${{steps.build_changelog.outputs.changelog}}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
A full set list of possible output values for this action.
|
||||||
|
|
||||||
|
| **Output** | **Description** |
|
||||||
|
|---------------------|-------------------------------------------------------------------------------------|
|
||||||
|
| `outputs.changelog` | The built release changelog built from the merged pull requests |
|
||||||
|
| `outputs.owner` | Specifies the owner of the repository processed |
|
||||||
|
| `outputs.repo` | Describes the repository name, which was processed |
|
||||||
|
| `outputs.fromTag` | Defines the `fromTag` which describes the lower bound to process pull requests for |
|
||||||
|
| `outputs.toTag` | Defines the `toTag` which describes the upper bound to process pull request for |
|
||||||
|
|
||||||
## Customization 🖍️
|
## Customization 🖍️
|
||||||
|
|
||||||
### Changelog Configuration
|
### Changelog Configuration
|
||||||
@@ -190,16 +199,9 @@ on:
|
|||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Retrieve tag
|
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
|
||||||
id: tag_version
|
|
||||||
run: echo ::set-output name=VERSION::$(echo ${GITHUB_REF:10})
|
|
||||||
|
|
||||||
- name: Build Changelog
|
- name: Build Changelog
|
||||||
id: github_release
|
id: github_release
|
||||||
uses: mikepenz/release-changelog-builder-action@main
|
uses: mikepenz/release-changelog-builder-action@main
|
||||||
with:
|
|
||||||
toTag: ${{ steps.tag_version.outputs.VERSION }}
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ async function run(): Promise<void> {
|
|||||||
core.error(`💥 Missing or couldn't resolve 'owner'`)
|
core.error(`💥 Missing or couldn't resolve 'owner'`)
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
|
core.setOutput('owner', owner)
|
||||||
core.debug(`Resolved 'owner' as ${owner}`)
|
core.debug(`Resolved 'owner' as ${owner}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,6 +97,7 @@ async function run(): Promise<void> {
|
|||||||
core.error(`💥 Missing or couldn't resolve 'owner'`)
|
core.error(`💥 Missing or couldn't resolve 'owner'`)
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
|
core.setOutput('repo', repo)
|
||||||
core.debug(`Resolved 'repo' as ${repo}`)
|
core.debug(`Resolved 'repo' as ${repo}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,6 +105,7 @@ async function run(): Promise<void> {
|
|||||||
core.error(`💥 Missing or couldn't resolve 'toTag'`)
|
core.error(`💥 Missing or couldn't resolve 'toTag'`)
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
|
core.setOutput('toTag', toTag)
|
||||||
core.debug(`Resolved 'toTag' as ${toTag}`)
|
core.debug(`Resolved 'toTag' as ${toTag}`)
|
||||||
}
|
}
|
||||||
core.endGroup()
|
core.endGroup()
|
||||||
|
|||||||
@@ -49,6 +49,13 @@ export class ReleaseNotes {
|
|||||||
core.endGroup()
|
core.endGroup()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.options.fromTag) {
|
||||||
|
core.error(`💥 Missing or couldn't resolve 'fromTag'`)
|
||||||
|
return configuration.empty_template ?? DefaultConfiguration.empty_template
|
||||||
|
} else {
|
||||||
|
core.setOutput('fromTag', this.options.fromTag)
|
||||||
|
}
|
||||||
|
|
||||||
core.startGroup(`🚀 Load pull requests`)
|
core.startGroup(`🚀 Load pull requests`)
|
||||||
const mergedPullRequests = await this.getMergedPullRequests(octokit)
|
const mergedPullRequests = await this.getMergedPullRequests(octokit)
|
||||||
core.endGroup()
|
core.endGroup()
|
||||||
|
|||||||
Reference in New Issue
Block a user