{"id":16057942,"url":"https://github.com/pascalgn/npm-publish-action","last_synced_at":"2025-05-16T17:07:35.650Z","repository":{"id":41965630,"uuid":"196760805","full_name":"pascalgn/npm-publish-action","owner":"pascalgn","description":"GitHub action to automatically publish packages to npm","archived":false,"fork":false,"pushed_at":"2023-11-24T09:40:46.000Z","size":124,"stargazers_count":224,"open_issues_count":16,"forks_count":29,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-07T01:04:22.192Z","etag":null,"topics":["github-actions","npm"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/pascalgn.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":"2019-07-13T19:52:51.000Z","updated_at":"2025-03-11T08:40:56.000Z","dependencies_parsed_at":"2024-08-13T14:40:23.192Z","dependency_job_id":null,"html_url":"https://github.com/pascalgn/npm-publish-action","commit_stats":{"total_commits":41,"total_committers":9,"mean_commits":4.555555555555555,"dds":0.5853658536585367,"last_synced_commit":"5994a39d5a3b75d0aad12f4527c1c1364a6bc977"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalgn%2Fnpm-publish-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalgn%2Fnpm-publish-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalgn%2Fnpm-publish-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalgn%2Fnpm-publish-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pascalgn","download_url":"https://codeload.github.com/pascalgn/npm-publish-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254573588,"owners_count":22093731,"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":["github-actions","npm"],"created_at":"2024-10-09T03:05:31.480Z","updated_at":"2025-05-16T17:07:35.629Z","avatar_url":"https://github.com/pascalgn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# npm-publish-action\n\nGitHub action to automatically publish packages to npm.\n\n## Usage\n\nCreate a new `.github/workflows/npm-publish.yml` file:\n\n```yaml\nname: npm-publish\non:\n  push:\n    branches:\n      - main # Change this to your default branch\njobs:\n  npm-publish:\n    name: npm-publish\n    runs-on: ubuntu-latest\n    steps:\n    - name: Checkout repository\n      uses: actions/checkout@v2\n    - name: Publish if version has been updated\n      uses: pascalgn/npm-publish-action@1.3.9\n      with: # All of theses inputs are optional\n        tag_name: \"v%s\"\n        tag_message: \"v%s\"\n        create_tag: \"true\"\n        commit_pattern: \"^Release (\\\\S+)\"\n        workspace: \".\"\n        publish_command: \"yarn\"\n        publish_args: \"--non-interactive\"\n      env: # More info about the environment variables in the README\n        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated\n        NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} # You need to set this in your repo settings\n```\n\nNow, when someone changes the version in `package.json` to 1.2.3 and pushes a commit with the message `Release 1.2.3`, the `npm-publish` action will create a new tag `v1.2.3` and publish the package to the npm registry.\n\n### Inputs\n\nThese inputs are optional: that means that if you don't enter them, default values will be used and it'll work just fine.\n\n- `tag_name`: the name pattern of the new tag\n- `tag_message`: the message pattern of the new tag\n- `create_tag`: whether to create a git tag or not (defaults to `\"true\"`)\n- `commit_pattern`: pattern that the commit message needs to follow\n- `workspace`: custom workspace directory that contains the `package.json` file\n- `publish_command`: custom publish command (defaults to `yarn`)\n- `publish_args`: publish command arguments (for example `--prod --verbose`, defaults to empty)\n\n### Environment variables\n\n- `GITHUB_TOKEN`: this is a token that GitHub generates automatically, you only need to pass it to the action as in the example\n- `NPM_AUTH_TOKEN`: this is the token the action will use to authenticate to [npm](https://npmjs.com). You need to generate one in npm, then you can add it to your secrets (settings -\u003e secrets) so that it can be passed to the action. DO NOT put the token directly in your workflow file.\n\n## Related projects\n\n- [npm-publish](https://github.com/JS-DevTools/npm-publish) is a similar project\n- [version-check](https://github.com/EndBug/version-check) allows to define custom workflows based on version changes\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpascalgn%2Fnpm-publish-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpascalgn%2Fnpm-publish-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpascalgn%2Fnpm-publish-action/lists"}