{"id":13616253,"url":"https://github.com/Songmu/tagpr","last_synced_at":"2025-04-14T00:31:55.035Z","repository":{"id":56775797,"uuid":"524603982","full_name":"Songmu/tagpr","owner":"Songmu","description":"automatically creates and updates a pull request for unreleased items, tag them when they are merged, and create releases.","archived":false,"fork":false,"pushed_at":"2024-10-27T14:02:26.000Z","size":345,"stargazers_count":212,"open_issues_count":10,"forks_count":20,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-11-06T16:50:27.464Z","etag":null,"topics":["github-actions","go"],"latest_commit_sha":null,"homepage":"","language":"Go","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/Songmu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["Songmu"]}},"created_at":"2022-08-14T07:35:48.000Z","updated_at":"2024-11-05T02:44:55.000Z","dependencies_parsed_at":"2023-11-15T04:28:46.523Z","dependency_job_id":"5fcf0a18-315a-4a04-a97e-ef2af361d684","html_url":"https://github.com/Songmu/tagpr","commit_stats":{"total_commits":259,"total_committers":9,"mean_commits":28.77777777777778,"dds":0.359073359073359,"last_synced_commit":"43d52e123cf8d55db9d602601f115f530588e2f8"},"previous_names":["songmu/rcpr"],"tags_count":49,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Songmu%2Ftagpr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Songmu%2Ftagpr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Songmu%2Ftagpr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Songmu%2Ftagpr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Songmu","download_url":"https://codeload.github.com/Songmu/tagpr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223381902,"owners_count":17136289,"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","go"],"created_at":"2024-08-01T20:01:25.905Z","updated_at":"2025-04-14T00:31:55.020Z","avatar_url":"https://github.com/Songmu.png","language":"Go","funding_links":["https://github.com/sponsors/Songmu"],"categories":["Go"],"sub_categories":[],"readme":"tagpr\n=======\n\n[![Test Status](https://github.com/Songmu/tagpr/workflows/test/badge.svg?branch=main)][actions]\n[![MIT License](https://img.shields.io/github/license/Songmu/tagpr)][license]\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/Songmu/tagpr)][PkgGoDev]\n\n[actions]: https://github.com/Songmu/tagpr/actions?workflow=test\n[license]: https://github.com/Songmu/tagpr/blob/main/LICENSE\n[PkgGoDev]: https://pkg.go.dev/github.com/Songmu/tagpr\n\nThe `tagpr` clarify the release flow. It automatically creates and updates a pull request for unreleased items, tag them when they are merged, and create releases.\n\n## Synopsis\n\nThe `tagpr` is designed to run on github actions.\n\n```yaml\n# .github/workflows/tagpr.yml\nname: tagpr\non:\n  push:\n    branches: [\"main\"]\njobs:\n  tagpr:\n    runs-on: ubuntu-latest\n    permissions:\n      contents: write\n      pull-requests: write\n      issues: write\n    steps:\n    - uses: actions/checkout@v4\n    - uses: Songmu/tagpr@v1\n      env:\n        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\nTo enable pull requests to be created through GitHub Actions, check the \"Allow GitHub Actions to create and approve pull requests\" box in the \"Workflow permissions\" section under \"Settings \u003e Actions \u003e General\" in the repository where you are installing `tagpr`.\n\nIf you do not want to use the token provided by GitHub Actions, do the following This is useful if you want to trigger another action with a tag.\n\nref. \u003chttps://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow\u003e\n\nFor simplicity, we include an example of specifying a personal access token here. However, issuing the temporary token in conjunction with the GitHub App would be safer than a personal access token.\n\n```yaml\nname: tagpr\non:\n  push:\n    branches:\n    - main\njobs:\n  tagpr:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v4\n      with:\n        token: ${{ secrets.GH_PAT }}\n    - uses: Songmu/tagpr@v1\n      env:\n        GITHUB_TOKEN: ${{ secrets.GH_PAT }}\n```\n\n## Description\nBy using `tagpr`, the release flow can be made easier and more apparent because it can be put into a flow where the release is completed by pressing the merge button on a pull request that is automatically created.\n\nIf there are differences between the last release and the main branch, tagpr generates a pull request for the next release. The tagpr considers a semver tagged commit as a release. It would be standard practice.\n\nYou can leave this pull request until you want to make the next release; each time the main branch is updated, this pull request will automatically follow it.\n\nWhen this pull request is merged, the merge commit is automatically tagged, and GitHub Releases are created simultaneously.\n\nAs mentioned at the beginning of this section, the release process becomes simply a matter of pressing the merge button.\n\nIn addition, release items will be made into pull requests, allowing for visualization and review of necessary changes at the time of release. This is also important to prevent accidents.\n\n## Versioning Rules\nHow tagpr proposes the next version number and how to adjust it.\n\n###  How to determine the next version number of candidate\nWhen creating a pull request by tagpr,  the next version number candidate is determined in the following way.\n\n- Conventional Labels: If the merged pull requests for the next release have labels named \"major\" or \"minor,\" the version is determined accordingly (of course, major has priority).\n- If no conventional labels are found, the patch version is incremented.\n\n### How to adjust the next version by yourself\nYou can adjust the next version number suggested by tagpr directly on the pull request created by tagpr.\n\nThere are two ways to do it.\n\n####  Version file\nEdit and commit the version file specified in the .tagpr configuration file to describe the next version\n\n####  Conventional labels\nAdd labels to the pull request like \"tagpr:minor\" or \"tagpr:major.\" It is helpful to use a flow that does not use version files.\n\nIf there is a discrepancy between the version file and the conventional labels at the time of merging, the specification in the version file takes precedence.\n\n## Configuration\nDescribe the settings in the .tagpr file directly under the repository in gitconfig format. This is automatically created the first time tagpr is run, but feel free to adjust it. The following configuration items are available\n\n### tagpr.releaseBranch\nGenerally, it is \"main.\" It is the branch for releases. The tagpr tracks this branch,\ncreates or updates a pull request as a release candidate, or tags when they are merged.\n\n### tagpr.versionFile\nVersioning file containing the semantic version needed to be updated at release.\nIt will be synchronized with the \"git tag\".\nOften this is a meta-information file such as gemspec, setup.cfg, package.json, etc.\nSometimes the source code file, such as version.go or Bar.pm, is used.\nIf you do not want to use versioning files but only git tags, specify the \"-\" string here.\nYou can specify multiple version files by comma separated strings.\n\n### tagpr.vPrefix\nFlag whether or not v-prefix is added to semver when git tagging. (e.g. v1.2.3 if true)  \nThis is only a tagging convention, not how it is described in the version file.\n\n### tagpr.changelog (Optional)\nFlag whether or not changelog is added or changed during the release.\n\n### tagpr.command (Optional)\nCommand to change files just before release.\n\n### tagpr.template (Optional)\nPull request template file in go template format\n\n### tagpr.templateText (Optional)\nPull request template text in go template format\n\n### tagpr.release (Optional)\nGitHub Release creation behavior after tagging `[true, draft, false]`  \nIf this value is not set, the release is to be created.\n\n### tagpr.majorLabels (Optional)\nLabel of major update targets. Default is [major]\n\n### tagpr.minorLabels (Optional)\nLabel of minor update targets. Default is [minor]\n\n### tagpr.commitPrefix (Optional)\nPrefix of commit message. Default is \"[tagpr]\"\n\n## GitHub Enterprise\nIf you are using GitHub Enterprise, use `GH_ENTERPRISE_TOKEN` instead of `GITHUB_TOKEN`.\n\n```yaml\n- uses: Songmu/tagpr@v1\n  env:\n    GH_ENTERPRISE_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n## Inputs for GitHub Actions\n\n### config (Optional)\nA path to the tagpr configuration file.\nIf not specified, it will be \".tagpr\" in the repository root.\n\n## Outputs for GitHub Actions\n\nThe tagpr produces output to be used in conjunction with subsequent GitHub Actions jobs.\n\n- `pull_request`: Information of the pull request created by tagpr in JSON format\n- `tag`: Tag strings are output only if the tagpr has tagged\n\nIt is useful to see if tag is available and to run tasks after release. The following is an example of running action-update-semver after release.\n\n```yaml\n- uses: actions/checkout@v4\n- id: tagpr\n  uses: Songmu/tagpr@v1\n  env:\n    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n- uses: haya14busa/action-update-semver@v1\n  if: \"steps.tagpr.outputs.tag != ''\"\n  with:\n    tag: ${{ steps.tagpr.outputs.tag }}\n```\n\n## Author\n\n[Songmu](https://github.com/Songmu)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSongmu%2Ftagpr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSongmu%2Ftagpr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSongmu%2Ftagpr/lists"}