Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wdzeng/version
GitHub action that gets the repository meta and version
https://github.com/wdzeng/version
Last synced: 14 days ago
JSON representation
GitHub action that gets the repository meta and version
- Host: GitHub
- URL: https://github.com/wdzeng/version
- Owner: wdzeng
- License: mit
- Created: 2022-06-16T23:50:52.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-12T14:28:51.000Z (8 months ago)
- Last Synced: 2024-03-12T15:48:48.550Z (8 months ago)
- Language: TypeScript
- Homepage:
- Size: 80.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Version Action
GitHub action for determining project's version.
This action not only tells the project version, but also other information like author, license and description.
## Prerequisites
- The project must have a package.json at root directory.
- The project version is a semver.
- Only support alpha and beta for pre-release versions.## Usage
```yml
jobs:
build:
name: Get version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: wdzeng/version@v1
```Note that it is user's responsibility to download repository or call `actions/checkout` workflow.
## Inputs
- `prefix`
- `v`: add a `v` to version prefix if not present
- empty string: if `v` is present then removes it
- `false`: (default) remain unchanged fetched from package.json## Outputs
- `major`: major version of project
- `minor`: minor version of project
- `patch`: patch version of project
- `version`: version of project
- `pre-release`: `true` if the version is a pre-release; else `false`
- `author`: project author; empty string if not stated in package.json
- `license`: project license; empty string if not stated in package.json
- `description`: project description; empty string if not stated in package.json## Examples
If the version in package.json is `1.0.0` and input `prefix` is an empty string:
- `output.major`: `1`
- `output.minor`: `1.0`
- `output.patch`: `1.0.0`
- `output.version`: `1.0.0`
- `output.pre-release`: `false`If the version in package.json is `1.0.0-alpha.1` and input `prefix` is an empty string:
- `output.major`: `1`
- `output.minor`: `1.0`
- `output.patch`: `1.0.0`
- `output.version`: `1.0.0-alpha.1`
- `output.pre-release`: `true`If the `author` in package.json is `foo`:
```json
"author": "foo"
```- `output.author`: `foo`
If the `author` in package.json is a dict:
```json
"author": {
"name": "foo",
"email": "[email protected]",
"url": "https://example.com/"
}
```- `output.author`: `foo (https://example.com/)`