From 4cea44f71ac0f0c6e31dbb1fffeae5826eec6e2a Mon Sep 17 00:00:00 2001 From: cycjimmy Date: Mon, 21 Oct 2019 13:30:51 +0800 Subject: [PATCH] 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 --- .github/workflows/release.yml | 6 +++--- README.md | 12 ++++++------ action.yml | 10 +++++----- src/index.js | 10 +++++----- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9d66fde..92f6724 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/README.md b/README.md index 5464c61..e6e99c4 100644 --- a/README.md +++ b/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 `""`. * `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: ... ``` diff --git a/action.yml b/action.yml index 3f6d950..cb9b529 100644 --- a/action.yml +++ b/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' 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' diff --git a/src/index.js b/src/index.js index 7ba2f95..83184ab 100644 --- a/src/index.js +++ b/src/index.js @@ -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', }; /**