mirror of
https://github.com/cycjimmy/semantic-release-action.git
synced 2025-11-07 10:46:56 +00:00
docs: add example for unset_gha_env
Signed-off-by: David van der Spek <david.vanderspek@flyrlabs.com>
This commit is contained in:
parent
266ea7eb8c
commit
9e59817a43
1 changed files with 23 additions and 0 deletions
23
README.md
23
README.md
|
|
@ -265,6 +265,29 @@ steps:
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### unset_gha_env
|
||||||
|
Setting this to true will unset the `GITHUB_ACTIONS` environment variable. This can be useful when wanting to validate things such as merging of a PR would create a valid release.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Temporarily merge PR branch
|
||||||
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
|
run: |
|
||||||
|
git config --global user.name github-actions
|
||||||
|
git config --global user.email github-actions@github.com
|
||||||
|
git merge --no-ff origin/${{ github.event.pull_request.head.ref }} --message "${{ github.event.pull_request.title }}"
|
||||||
|
- name: Semantic Release
|
||||||
|
uses: cycjimmy/semantic-release-action@v4
|
||||||
|
with:
|
||||||
|
unset_gha_env: ${{ github.event_name == 'pull_request' }}
|
||||||
|
ci: ${{ github.event_name == 'pull_request' && false || '' }}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
```
|
||||||
|
|
||||||
### Outputs
|
### Outputs
|
||||||
| Output Parameter | Description |
|
| Output Parameter | Description |
|
||||||
|:-------------------------:|-----------------------------------------------------------------------------------------------------------------------------------|
|
|:-------------------------:|-----------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue