Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ steps:
| `changelog-file` | Create a changelog file (e.g CHANGELOG.md) | Optional |
| `ghr` | Create a .ghr file with the parameters for [tcnksm/ghr](https://github.com/tcnksm/ghr) | Optional |
| `update-file` | Update the version of a certain file | Optional |
| `update-before` | Update files before release creation (format: `file:regex:template`). Supports multiline input for multiple files. Changes are committed and pushed before the release is tagged. | Optional |
| `dry` | Do not create a release | Optional |
| `prerelease` | Flags the release as a prerelease | Optional |
| `draft` | Create a draft release instead of publishing immediately | Optional |
| `allow-initial-development-versions` | semantic-release will start your initial development release at 0.1.0 and will handle breaking changes as minor version updates. This option will be ignored if a release with major version greater than or equal 1 exists. | Optional |
| `force-bump-patch-version` | Increments the patch version if no changes are found | Optional |
| `changelog-generator-opt` | Options that are passed to the changelog-generator plugin. Seperated by "," | Optional |
Expand Down Expand Up @@ -89,6 +91,26 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
```

## Example with `update-before` for polyglot repositories

```yaml
- uses: go-semantic-release/action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
update-before: |
VERSION:^.*$:{{version}}
__version__.py:__version__ = ".*":__version__ = "{{version}}"
src/version.go:const Version = ".*":const Version = "{{version}}"
```

This will update multiple version files, commit the changes with message `chore: bump version to X.Y.Z`, and include the commit in the release tag. Template variables available: `{{version}}`, `{{major}}`, `{{minor}}`, `{{patch}}`.

**Important notes:**
- Patterns use colon (`:`) as delimiter in format `file:regex:template`. Windows drive letters (e.g., `C:\path`) are not supported.
- The regex pattern must match content in the file, otherwise the release will fail with an error.
- File permissions are preserved during updates.
- The feature is automatically skipped when using `dry: true`.

## License

The [MIT License (MIT)](http://opensource.org/licenses/MIT)
Expand Down
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@ inputs:
update-file:
description: 'updates the version of a certain file'
required: false
update-before:
description: 'updates files before release creation (format: file:regex:template, can be multiline for multiple files)'
required: false
dry:
description: 'do not create release'
required: false
prerelease:
description: 'flags the release as a prerelease'
required: false
draft:
description: 'create a draft release instead of publishing immediately'
required: false
prepend:
description: 'flag changes to be prepended into the changelog'
required: false
Expand Down
Binary file modified bun.lockb
Binary file not shown.
Loading