{"id":20313683,"url":"https://github.com/posthog/check-package-version","last_synced_at":"2026-04-02T01:14:24.952Z","repository":{"id":48296247,"uuid":"339366301","full_name":"PostHog/check-package-version","owner":"PostHog","description":"Release automatically with this npm package version check by PostHog","archived":false,"fork":false,"pushed_at":"2025-02-06T12:17:27.000Z","size":640,"stargazers_count":7,"open_issues_count":3,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-08T12:50:51.746Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PostHog.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-16T10:47:47.000Z","updated_at":"2025-03-03T11:32:34.000Z","dependencies_parsed_at":"2024-08-13T14:29:44.272Z","dependency_job_id":"44a77226-f247-427c-b300-b8ed77c2a312","html_url":"https://github.com/PostHog/check-package-version","commit_stats":{"total_commits":119,"total_committers":2,"mean_commits":59.5,"dds":0.2857142857142857,"last_synced_commit":"8c5c240ca384d62f74001510572b05463f71d255"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":"actions/typescript-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PostHog%2Fcheck-package-version","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PostHog%2Fcheck-package-version/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PostHog%2Fcheck-package-version/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PostHog%2Fcheck-package-version/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PostHog","download_url":"https://codeload.github.com/PostHog/check-package-version/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248447600,"owners_count":21105140,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T18:12:21.790Z","updated_at":"2026-04-02T01:14:24.945Z","avatar_url":"https://github.com/PostHog.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Check Package Version\n\n[![build-test status](https://github.com/PostHog/check-package-version/workflows/build-test/badge.svg)](https://github.com/actions/typescript-action/actions)\n[![MIT License](https://img.shields.io/badge/License-MIT-red.svg)](https://opensource.org/licenses/MIT)\n\nGitHub action to compare `package.json` version between the current repo state and [npm](https://npmjs.com). Publish new versions of your npm packages hands-free!\n\nBy [PostHog](https://posthog.com).\n\n## Usage\n\n```yml\n- name: Check out repository\n  uses: actions/checkout@v2\n\n- name: Check package version\n  id: cpv\n  uses: PostHog/check-package-version@v2\n\n- name: Echo output\n  run: |\n      echo \"Committed version: ${{ steps.cpv.outputs.committed-version }}\"\n      echo \"Published version: ${{ steps.cpv.outputs.published-version }}\"\n      echo \"Is new version: ${{ steps.cpv.outputs.is-new-version }}\"\n```\n\n### Action inputs\n\nAll inputs are **optional**. If not set, sensible defaults will be used.\n\n| Name                  | Description                           | Default |\n| --------------------- | ------------------------------------- | ------- |\n| `path`                | Path to the npm package               | `.`     |\n| `fail-on-new-package` | Whether to fail if the package is new | `false` |\n\n### Action outputs\n\nThe following outputs can be used by subsequent workflow steps.\n\n| Name                | Description                                                                                        |\n| ------------------- | -------------------------------------------------------------------------------------------------- |\n| `committed-version` | Version now committed to the repo                                                                  |\n| `published-version` | Latest version published to npm, based on `dist-tags` (this won't be set for new packages)         |\n| `is-new-version`    | Whether repo version is newer than npm version (or package does not exists), `'true'` or `'false'` |\n| `is-new-package`    | Whether repo package has not been published yet (`\"true\"` or `\"false\"`)                            |\n\n### Workflow example\n\nHere's a simple example of a GitHub Actions workflow running `npm publish` automatically when `package.json` version is bumped in the default branch:\n\n```yml\nname: 'Autopublish'\n\non:\n    push:\n        branches:\n            - main\n            - master\n\njobs:\n    autopublish:\n        name: Publish release if package.json version was bumped\n        runs-on: ubuntu-20.04\n        steps:\n            - name: Check out repository\n              uses: actions/checkout@v2\n\n            - name: Check package version\n              id: cpv\n              uses: PostHog/check-package-version@v2\n\n            - name: Echo versions\n              run: |\n                  echo \"Committed version: ${{ steps.cpv.outputs.committed-version }}\"\n                  echo \"Published version: ${{ steps.cpv.outputs.published-version }}\"\n\n            - name: Install dependencies\n              if: steps.cpv.outputs.is-new-version == 'true'\n              run: npm ci\n\n            - name: Publish new version\n              if: steps.cpv.outputs.is-new-version == 'true'\n              run: npm publish\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthog%2Fcheck-package-version","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposthog%2Fcheck-package-version","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthog%2Fcheck-package-version/lists"}