You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Enforce Package Dependency Version
v1.1.0
This Github Actions helps enforce that a specific package version, range, prerelease, etc exists in your package.json
and yarn.lock
.
yarn why …
, so only yarn is supported for now.
This action runs itself here.
name: Enforce Package
on: push
jobs:
typescript:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: "Enforce Version"
id: enforce
uses: kylorhall/[email protected]
with:
package: "typescript"
range: ">=4.2.0"
- name: Debug
if: always()
run: |
echo target_version: ${{ steps.enforce.outputs.target_version }}
echo resolved_version: ${{ steps.enforce.outputs.resolved_version }}
package
[required]- The name of the dependency to check.
directory
- Directory where your
package.json
can be found. default=env.GITHUB_WORKSPACE
- Directory where your
range
[required]- A semver range, eg. '^1.0.0', '1.0.0', '>=1.x', etc..
version_prerelease
- An optional prerelease target.
default=false
false
requires there is no prerelease.true
allows a prerelease—but it is not required!1.2.3-prerelease
and1.2.3
are both valid'prerelease'
means it must match that prerelease.'prerelease.#'
means it must match that prerelease and identifier.
allow_multiple_versions
- Whether or not we allow multiple versions to be resolved, eg. you may have Typescript at
^4.2.0
in your codebase, but another package points to3.x
. false
means this should only ever resolve to a single version (and that should match our range)true
allows all versions… NOTE: we only look at the first resolved version, assuming this is your version.
- Whether or not we allow multiple versions to be resolved, eg. you may have Typescript at
yarn install
code .
yarn jest:tdd
Manually build a New Release: here
- Deicde on a semver like
v1.2.3
⚠️ Point the release to the correct commit (not main).@latest
isn't used.- Bump this version in
package.json
file—just for the sake of it. - Bump this version in
.github/workflows/package-enforcement.yml
file. - Bump this version in
README.md
file.