This repo is a vendored fork of: https://github.com/avides/actions-project-version-check.
API changes, so major bump
- target branch now defaults to main, and must be set.
- Failure on bump / not is now an explicit flag (fail-build-if-not-bumped). The updated project version and semver result is now always output as a variable.
- Additional files now fails only if the branch version isn't there AND the target version is.
Compatible with forked version.
- Removal of XML parser to reduce dependencies
- upgrade dependencies and lint rules.
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. If the new version is not higher than the old one from target, the action fails.
Currently supported are package.json
and version.txt
.
Required The repository token is used to request the target branch file-to-check
-file from the GitHub API
Required Filename (with path) that must contain the project version update (examples: pom.xml, package.json or version.txt)
Required The target branch. Must be set.
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)
Is used to fail the build if version isn't bumped. defaults to true.
If the version update is valid then the new version is available as output.
Returns the output of semver-diff, or "no-output"
- uses: thomastay/actions-project-version-check@latest
id: actions_project_version_check
with:
token: ${{ secrets.GITHUB_TOKEN }}
file-to-check: pom.xml
target-branch: main
- name: use-version-from-check
run: echo "New version is: " ${{ steps.actions_project_version_check.outputs.version }}
- name: use-semver-from-check
run: echo "Semver diff returned: " ${{ steps.actions_project_version_check.outputs.semver }}