{"id":15691626,"url":"https://github.com/jamesmgreene/node-draft-releaser","last_synced_at":"2025-05-08T01:13:42.181Z","repository":{"id":48271198,"uuid":"202276032","full_name":"JamesMGreene/node-draft-releaser","owner":"JamesMGreene","description":"Automatically publish an existing Draft Release when the \"package.json\" version changes","archived":false,"fork":false,"pushed_at":"2021-08-03T19:55:04.000Z","size":2961,"stargazers_count":8,"open_issues_count":19,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-08T01:13:35.674Z","etag":null,"topics":["deployment","github-actions","nodejs","publishing","release","release-automation","release-drafter","release-management"],"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/JamesMGreene.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-14T04:43:06.000Z","updated_at":"2023-09-20T06:10:37.000Z","dependencies_parsed_at":"2023-01-11T17:23:04.838Z","dependency_job_id":null,"html_url":"https://github.com/JamesMGreene/node-draft-releaser","commit_stats":{"total_commits":101,"total_committers":3,"mean_commits":"33.666666666666664","dds":0.504950495049505,"last_synced_commit":"c4749846e6592bbf4494d5368df3f82890872232"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesMGreene%2Fnode-draft-releaser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesMGreene%2Fnode-draft-releaser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesMGreene%2Fnode-draft-releaser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesMGreene%2Fnode-draft-releaser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JamesMGreene","download_url":"https://codeload.github.com/JamesMGreene/node-draft-releaser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252978783,"owners_count":21834917,"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":["deployment","github-actions","nodejs","publishing","release","release-automation","release-drafter","release-management"],"created_at":"2024-10-03T18:22:33.779Z","updated_at":"2025-05-08T01:13:42.149Z","avatar_url":"https://github.com/JamesMGreene.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Action: `node-draft-releaser`\n\n[![GitHub Marketplace version](https://img.shields.io/github/release/JamesMGreene/node-draft-releaser.svg?label=Marketplace\u0026logo=github)](https://github.com/marketplace/actions/node-draft-releaser)\n\nAutomatically publish an existing Draft Release when the `\"package.json\"` version changes.\n\nThis Action [pairs](#including-release-drafter) exquisitely well with [Release Drafter](https://github.com/marketplace/actions/release-drafter).\n\nIt is also a great addition to any workflows that culminate in [publishing a Node package to an NPM Registry such as the GitHub Package Registry](#including-publishing-to-github-package-registry).\n\n## Usage\n\n### Configuration\n\n#### Secrets\n\nIn addition to a handful of the standard environment variables provided during a GitHub Actions workflow run, this Action also expects the following Secret(s) to be provided:\n\n - `GITHUB_TOKEN` _(required)_\n     - The [`GITHUB_TOKEN` Secret](https://help.github.com/en/articles/virtual-environments-for-github-actions#github_token-secret) is a GitHub App installation token scoped to a repository. GitHub creates the `GITHUB_TOKEN` secret for you by default, but you must include it in your workflow file in order for this Action to use it.\n\n#### Inputs\n\nThis Action can react to the following inputs:\n\n - `allow_unmatched_draft_tag` _(optional)_\n     - Should this Action be allowed to publish an existing Draft Release that is _not_ slated to create a Tag matching the new version number?\n     - Valid values: `'true'` or `'false'` _(as a **string**)_\n     - Defaults to `'true'`.\n - `allow_release_name_update` _(optional)_\n     - Should this Action be allowed to update the name of an existing Draft Release _if_ its current name is a different valid SemVer version number?\n     - Valid values: `'true'` or `'false'` _(as a **string**)_\n     - Defaults to `'true'`.\n\n#### Outputs\n\nThis Action provides the following outputs:\n\n - `version`\n     - The new version number that was released, e.g. `1.0.0-beta.2`\n\n - `release_id`\n     - The ID of the Release\n\n - `release_url`\n     - The URL to view the published Release page in the GitHub UI\n\n - `release_name`\n     - The name of the Release\n\n## Examples\n\n### Basic Usage\n\nIn one of your GitHub Actions V2 workflow YAML files:\n\n```yaml\nname: 'Publish Draft Release'\n\non:\n  push:\n    # branches to consider in the event; optional, defaults to all\n    branches:\n      - master\n    # file paths to consider in the event; optional, defaults to all\n    paths:\n      - package.json\n\njobs:\n  publish_draft_release_on_version_bump:\n    runs-on: ubuntu-latest\n    steps:\n      # Does a checkout of your repository at the pushed commit SHA\n      - uses: actions/checkout@v1\n      # Checks for a version bump to publish an existing Draft Release\n      - uses: JamesMGreene/node-draft-releaser@v1\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        with:\n          allow_unmatched_draft_tag: 'false'  # default value = 'true'\n```\n\n### Sample Chained Workflows\n\n#### Including Release Drafter\n\nSetting up your GitHub Actions workflow to also use [Release Drafter](https://github.com/marketplace/actions/release-drafter) is a great combination with this Action! 💪\n\n_IMPORTANT:_ To enable Release Drafter, you must also include a [`.github/release-drafter.yml` configuration file](https://github.com/marketplace/actions/release-drafter#example) in your repository.\n\n```yaml\nname: 'Draft Releases \u0026 Release Drafts'\n\non:\n  push:\n    # branches to consider in the event; optional, defaults to all\n    branches:\n      - master\n\njobs:\n  update_draft_release:\n    runs-on: ubuntu-latest\n    steps:\n      # Drafts your next Release notes as Pull Requests are merged into \"master\"\n      - uses: toolmantim/release-drafter@v5.2.0\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n  publish_draft_release_on_version_bump:\n    needs: [update_draft_release]\n    runs-on: ubuntu-latest\n    steps:\n      # Does a checkout of your repository at the pushed commit SHA\n      - uses: actions/checkout@v1\n      # Checks for a version bump to publish an existing Draft Release\n      - id: github_release\n        uses: JamesMGreene/node-draft-releaser@v1\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n      # Show the Release URL, just for fun\n      - run: echo \"Released at $RELEASE_URL\"\n        env:\n          RELEASE_URL: ${{ steps.github_release.outputs.release_url }}\n```\n\n#### Including Publishing to GitHub Package Registry\n\nAnother great chaining opportunity is following this Action with one to publish the new version to the GitHub Package Registry.\n\n```yaml\nname: 'Release Management'\n\non:\n  push:\n    # branches to consider in the event; optional, defaults to all\n    branches:\n      - master\n\njobs:\n  update_draft_release:\n    runs-on: ubuntu-latest\n    steps:\n      # Drafts your next Release notes as Pull Requests are merged into \"master\"\n      - uses: toolmantim/release-drafter@v5.2.0\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n  publish_draft_release_on_version_bump:\n    needs: [update_draft_release]\n    runs-on: ubuntu-latest\n    steps:\n      # Does a checkout of your repository at the pushed commit SHA\n      - uses: actions/checkout@v1\n      # Checks for a version bump to publish an existing Draft Release\n      - id: github_release\n        uses: JamesMGreene/node-draft-releaser@v1\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n      # Show the Release URL, just for fun\n      - run: echo \"Released at $RELEASE_URL\"\n        env:\n          RELEASE_URL: ${{ steps.github_release.outputs.release_url }}\n\n  publish_package_to_gpr:\n    needs: [publish_draft_release_on_version_bump]\n    runs-on: ubuntu-latest\n    steps:\n      # Does a checkout of your repository at the pushed commit SHA\n      - uses: actions/checkout@v1\n      # Set up the local Node environment for the NPM CLI\n      - uses: actions/setup-node@v1\n        with:\n          node-version: '10.x'\n          registry-url: 'https://npm.pkg.github.com'\n      # Install dependencies in case there are any publish-related scripts\n      - run: npm install\n      # Publish the new version to GPR\n      - run: npm publish\n        env:\n          NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n## License\n\n[MIT License](LICENSE.md) (c) 2020 James M. Greene\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesmgreene%2Fnode-draft-releaser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesmgreene%2Fnode-draft-releaser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesmgreene%2Fnode-draft-releaser/lists"}