{"id":19022540,"url":"https://github.com/flood-io/is-published-on-npm","last_synced_at":"2025-04-23T08:16:41.893Z","repository":{"id":43903617,"uuid":"329805036","full_name":"flood-io/is-published-on-npm","owner":"flood-io","description":"A GitHub Action to check if the current repositories package is published on NPM.","archived":false,"fork":false,"pushed_at":"2023-01-05T13:17:00.000Z","size":2617,"stargazers_count":8,"open_issues_count":13,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-04T14:46:25.404Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/flood-io.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}},"created_at":"2021-01-15T04:06:20.000Z","updated_at":"2024-07-16T14:41:40.000Z","dependencies_parsed_at":"2023-01-11T17:22:29.523Z","dependency_job_id":null,"html_url":"https://github.com/flood-io/is-published-on-npm","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"8478347e2650eb228d303975415458183d0a37e4"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flood-io%2Fis-published-on-npm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flood-io%2Fis-published-on-npm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flood-io%2Fis-published-on-npm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flood-io%2Fis-published-on-npm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flood-io","download_url":"https://codeload.github.com/flood-io/is-published-on-npm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223749468,"owners_count":17196250,"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-08T20:26:37.848Z","updated_at":"2024-11-08T20:26:39.408Z","avatar_url":"https://github.com/flood-io.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flood-io/is-published-on-npm\n\n[![Test Workflow Status](https://github.com/flood-io/is-published-on-npm/workflows/Test/badge.svg)](https://github.com/flood-io/is-published-on-npm/actions)\n\nThis GitHub Action checks if a repositories package version as defined in `package.json` is published on NPM and sets outputs accordingly.\n\nCheck the example to see how this could be helpful to automating your release workflow.\n\n## Usage\n\n### Pre-requisites\n\nYour workflow job must first checkout your repository and setup node before using this action, for example:\n\n```yml\n- uses: actions/checkout@v2\n- uses: actions/setup-node@v1\n```\n\n### Inputs\n\n- `dir`: The directory containing the `package.json` to check is published. Default: `./`.\n\n### Outputs\n\n- `published`: `'true'` if the package with `name` and `version` as defined in `package.json` is published, `'false'` if it isn't. **Note**: This value is, as are all GitHub Action outputs, a **string**.\n- `version`: The `version` as defined in `package.json`.\n\n### Example workflow - Publish a new version if not published on NPM\n\nOn every `push` to branch `master`, publish the package to NPM if it isn't already published.\n\n```yml\nname: Publish Package\n\non:\n  push:\n    branches:\n      - master\n\njobs:\n  publish:\n    name: Publish Package\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n      - uses: actions/setup-node@v1\n      - uses: flood-io/is-published-on-npm@v1\n        id: is-published\n      - run: npm publish\n        if: ${{ steps.is-published.outputs.published == 'false' }}\n        env:\n          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}\n```\n\n### Example workflow - Create a GitHub Release if not published on NPM\n\nOn every `push` to branch `master`, create a new GitHub release if it isn't already published to NPM.\n\n```yml\nname: Release Package\n\non:\n  push:\n    branches:\n      - master\n\njobs:\n  release:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n      - uses: actions/setup-node@v1\n      - uses: flood-io/is-published-on-npm@v1\n        id: is-published\n      - name: Release\n        if: ${{ steps.is-published.outputs.published == 'false' }}\n        uses: actions/create-release@v1\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        with:\n          tag_name: ${{ steps.is-published.outputs.version }}\n          release_name: Release ${{ steps.is-published.outputs.version }}\n          draft: false\n          prerelease: false\n```\n\n## License\n\nThe scripts and documentation in this project are released under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflood-io%2Fis-published-on-npm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflood-io%2Fis-published-on-npm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflood-io%2Fis-published-on-npm/lists"}