Skip to content

Commit

Permalink
style(outputs): uniform outputs to underline format
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cycjimmy committed Oct 21, 2019
1 parent 463a57b commit 4cea44f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: ...
```

10 changes: 5 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};

/**
Expand Down

0 comments on commit 4cea44f

Please sign in to comment.