5
0
Fork 0
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:
David van der Spek 2025-03-11 10:39:58 +01:00
parent 266ea7eb8c
commit 9e59817a43

View file

@ -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 |
|:-------------------------:|-----------------------------------------------------------------------------------------------------------------------------------| |:-------------------------:|-----------------------------------------------------------------------------------------------------------------------------------|