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:
parent
463a57bad7
commit
4cea44f71a
4 changed files with 19 additions and 19 deletions
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
|
|
@ -55,14 +55,14 @@ jobs:
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|
||||||
- name: Publish To GitHub Package Registry
|
- 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'
|
run: npm publish --@cycjimmy:registry='https://npm.pkg.github.com'
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
|
||||||
- name: Push updates to branch for major version
|
- name: Push updates to branch for major version
|
||||||
if: steps.semantic.outputs.new-release-published == 'true'
|
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}}"
|
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:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
|
|
||||||
12
README.md
12
README.md
|
|
@ -21,11 +21,11 @@ GitHub Action for [Semantic Release](https://github.com/semantic-release/semanti
|
||||||
* `extra_plugins`: [Optional] Extra plugins for pre-install. Default `""`.
|
* `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 `""`.
|
* `dry_run`: [Optional] Whether to run semantic release in "dry-run" mode. It will override the dryRun attribute in your configuration file. Default `""`.
|
||||||
* outputs:
|
* outputs:
|
||||||
* `new-release-published`: Whether a new release was published. `true` or `false`
|
* `new_release_published`: Whether a new release was published. `true` or `false`
|
||||||
* `new-release-version`: Version of the new release
|
* `new_release_version`: Version of the new release
|
||||||
* `new-release-major-version`: Major 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_minor_version`: Minor version of the new release
|
||||||
* `new-release-patch-version`: Patch version of the new release
|
* `new_release_patch_version`: Patch version of the new release
|
||||||
|
|
||||||
A simple example
|
A simple example
|
||||||
```yaml
|
```yaml
|
||||||
|
|
@ -53,7 +53,7 @@ steps:
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|
||||||
- name: Do something when a new release published
|
- 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: ...
|
run: ...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
10
action.yml
10
action.yml
|
|
@ -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'
|
description: 'Whether to run semantic release in "dry-run" mode. It will override the dryRun attribute in your configuration file'
|
||||||
default: ''
|
default: ''
|
||||||
outputs:
|
outputs:
|
||||||
new-release-published:
|
new_release_published:
|
||||||
description: 'Whether a new release was published'
|
description: 'Whether a new release was published'
|
||||||
new-release-version:
|
new_release_version:
|
||||||
description: "Version of the new release"
|
description: "Version of the new release"
|
||||||
new-release-major-version:
|
new_release_major_version:
|
||||||
description: "Major version of the new release"
|
description: "Major version of the new release"
|
||||||
new-release-minor-version:
|
new_release_minor_version:
|
||||||
description: "Minor version of the new release"
|
description: "Minor version of the new release"
|
||||||
new-release-patch-version:
|
new_release_patch_version:
|
||||||
description: "Patch version of the new release"
|
description: "Patch version of the new release"
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node12'
|
||||||
|
|
|
||||||
10
src/index.js
10
src/index.js
|
|
@ -4,11 +4,11 @@ const core = require('@actions/core');
|
||||||
const semanticRelease = require('semantic-release');
|
const semanticRelease = require('semantic-release');
|
||||||
|
|
||||||
const OutputKeys = {
|
const OutputKeys = {
|
||||||
newReleasePublished: 'new-release-published',
|
newReleasePublished: 'new_release_published',
|
||||||
newReleaseVersion: 'new-release-version',
|
newReleaseVersion: 'new_release_version',
|
||||||
newReleaseMajor: 'new-release-major-version',
|
newReleaseMajor: 'new_release_major_version',
|
||||||
newReleaseMinor: 'new-release-minor-version',
|
newReleaseMinor: 'new_release_minor_version',
|
||||||
newReleasePatch: 'new-release-patch-version',
|
newReleasePatch: 'new_release_patch_version',
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue