5
0
Fork 0
mirror of https://github.com/cycjimmy/semantic-release-action.git synced 2025-11-07 10:46:56 +00:00

style(outputs): uniform outputs to underline format

uniform outputs to underline format

BREAKING CHANGE: uniform outputs to underline format

Before:

outputs:
- new-release-published:
- new-release-version
- new-release-major-version
- new-release-minor-version
- new-release-patch-version

After:

outputs:
- new_release_published:
- new_release_version
- new_release_major_version
- new_release_minor_version
- new_release_patch_version
This commit is contained in:
cycjimmy 2019-10-21 13:30:51 +08:00
parent 463a57bad7
commit 4cea44f71a
4 changed files with 19 additions and 19 deletions

View file

@ -55,14 +55,14 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish To GitHub Package Registry
if: steps.semantic.outputs.new-release-published == 'true'
if: steps.semantic.outputs.new_release_published == 'true'
run: npm publish --@cycjimmy:registry='https://npm.pkg.github.com'
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Push updates to branch for major version
if: steps.semantic.outputs.new-release-published == 'true'
run: "git push https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:refs/heads/v${{steps.semantic.outputs.new-release-major-version}}"
if: steps.semantic.outputs.new_release_published == 'true'
run: "git push https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:refs/heads/v${{steps.semantic.outputs.new_release_major_version}}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -21,11 +21,11 @@ GitHub Action for [Semantic Release](https://github.com/semantic-release/semanti
* `extra_plugins`: [Optional] Extra plugins for pre-install. Default `""`.
* `dry_run`: [Optional] Whether to run semantic release in "dry-run" mode. It will override the dryRun attribute in your configuration file. Default `""`.
* outputs:
* `new-release-published`: Whether a new release was published. `true` or `false`
* `new-release-version`: Version of the new release
* `new-release-major-version`: Major version of the new release
* `new-release-minor-version`: Minor version of the new release
* `new-release-patch-version`: Patch version of the new release
* `new_release_published`: Whether a new release was published. `true` or `false`
* `new_release_version`: Version of the new release
* `new_release_major_version`: Major version of the new release
* `new_release_minor_version`: Minor version of the new release
* `new_release_patch_version`: Patch version of the new release
A simple example
```yaml
@ -53,7 +53,7 @@ steps:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Do something when a new release published
if: steps.semantic.outputs.new-release-published == 'true'
if: steps.semantic.outputs.new_release_published == 'true'
run: ...
```

View file

@ -15,15 +15,15 @@ inputs:
description: 'Whether to run semantic release in "dry-run" mode. It will override the dryRun attribute in your configuration file'
default: ''
outputs:
new-release-published:
new_release_published:
description: 'Whether a new release was published'
new-release-version:
new_release_version:
description: "Version of the new release"
new-release-major-version:
new_release_major_version:
description: "Major version of the new release"
new-release-minor-version:
new_release_minor_version:
description: "Minor version of the new release"
new-release-patch-version:
new_release_patch_version:
description: "Patch version of the new release"
runs:
using: 'node12'

View file

@ -4,11 +4,11 @@ const core = require('@actions/core');
const semanticRelease = require('semantic-release');
const OutputKeys = {
newReleasePublished: 'new-release-published',
newReleaseVersion: 'new-release-version',
newReleaseMajor: 'new-release-major-version',
newReleaseMinor: 'new-release-minor-version',
newReleasePatch: 'new-release-patch-version',
newReleasePublished: 'new_release_published',
newReleaseVersion: 'new_release_version',
newReleaseMajor: 'new_release_major_version',
newReleaseMinor: 'new_release_minor_version',
newReleasePatch: 'new_release_patch_version',
};
/**