https://github.com/avides/actions-project-version-check
GitHub Action that checks if the project version has been updated
https://github.com/avides/actions-project-version-check
actions github-actions github-actions-javascript nodejs
Last synced: about 2 months ago
JSON representation
GitHub Action that checks if the project version has been updated
- Host: GitHub
- URL: https://github.com/avides/actions-project-version-check
- Owner: avides
- License: mit
- Created: 2020-04-08T10:24:44.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2025-02-02T19:38:51.000Z (about 1 year ago)
- Last Synced: 2025-10-14T09:54:41.395Z (5 months ago)
- Topics: actions, github-actions, github-actions-javascript, nodejs
- Language: JavaScript
- Size: 562 KB
- Stars: 10
- Watchers: 2
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# actions-project-version-check
This action checks if the project version has been updated in your pull request. The action will request the file content (file with name from environment variable `file-to-check`) from the pull request target branch and parse the project version. After that the local project version will be checked against the targets one with [semver-diff](https://www.npmjs.com/package/semver-diff). If the new version is not higher than the old one from target, the action fails.
Currently supported are `pom.xml`, `package.json` and `version.txt`.
## Inputs
### `token`
**Required** The repository token is used to request the target branch `file-to-check`-file from the [GitHub API](https://developer.github.com/v3/repos/contents/#get-contents)
### `file-to-check`
**Required** Filename (with path) that must contain the project version update (examples: pom.xml, package.json or version.txt)
### `additional-files-to-check`
Comma separated list of filenames (with path) that must contain the same version as "file-to-check" (examples: README.md, src/file-with-version.txt)
### `only-return-version`
Is used to disable the whole version check and only return the project version as output for usage in other actions
## Outputs
### `version`
If the version update is valid then the new version is available as output. Usage:
``` yaml
- uses: avides/actions-project-version-check@latest
id: actions_project_version_check
with:
token: ${{ secrets.GITHUB_TOKEN }}
file-to-check: pom.xml
- name: use-version-from-check
run: echo "New version is: " ${{ steps.actions_project_version_check.outputs.version }}
```
## Example usage
``` yaml
- uses: avides/actions-project-version-check@v2.0.0
- with:
token: ${{ secrets.GITHUB_TOKEN }}
file-to-check: package.json
additional-files-to-check: README.md
```