mirror of
https://github.com/cycjimmy/semantic-release-action.git
synced 2025-11-07 10:46:56 +00:00
GitHub Action for Semantic Release
Issue: "Failed to replace env in config: ${NPM_TOKEN}" after release #2
solution:https://github.com/semantic-release/semantic-release/issues/974#issuecomment-546577677
|
||
|---|---|---|
| .github | ||
| docs | ||
| src | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| .npmignore | ||
| action.yml | ||
| CODE_OF_CONDUCT.md | ||
| index.js | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| release.config.js | ||
Semantic Release Action
GitHub Action for Semantic Release.
Usage
Step1: Set any Semantic Release Configuration in your repository.
Step2: Add Secrets in your repository for the Semantic Release Authentication Environment Variables.
Step3: Add a Workflow File to your repository to create custom automated processes.
- inputs:
branch: [Optional] The branch for release. Default"master".extra_plugins: [Optional] Extra plugins for pre-install.dry_run: [Optional] Whether to run semantic release in "dry-run" mode. It will override the dryRun attribute in your configuration file.
- outputs:
new_release_published: Whether a new release was published.trueorfalsenew_release_version: Version of the new releasenew_release_major_version: Major version of the new releasenew_release_minor_version: Minor version of the new releasenew_release_patch_version: Patch version of the new release
A simple example
steps:
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
An advanced example
steps:
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
id: semantic # Need an `id` for output variables
with:
branch: master
extra_plugins: |
@semantic-release/git
@semantic-release/changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Do something when a new release published
if: steps.semantic.outputs.new_release_published == 'true'
run: ...