{"id":14986024,"url":"https://github.com/jaliborc/action-general-autotag","last_synced_at":"2025-04-11T21:31:14.846Z","repository":{"id":35110448,"uuid":"207904948","full_name":"Jaliborc/action-general-autotag","owner":"Jaliborc","description":":octocat:  Automatically generate new tags by extracting their names from a given source file","archived":false,"fork":false,"pushed_at":"2023-07-12T02:55:55.000Z","size":510,"stargazers_count":7,"open_issues_count":5,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T08:16:29.496Z","etag":null,"topics":["action","automation","autotag","github-actions","node","nodejs","package","tag"],"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/Jaliborc.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":{"patreon":"jaliborc"}},"created_at":"2019-09-11T20:54:06.000Z","updated_at":"2024-11-03T03:09:35.000Z","dependencies_parsed_at":"2024-10-13T23:20:45.813Z","dependency_job_id":"c0235467-b6cd-4124-ac23-8d4ee4201ade","html_url":"https://github.com/Jaliborc/action-general-autotag","commit_stats":{"total_commits":81,"total_committers":4,"mean_commits":20.25,"dds":"0.40740740740740744","last_synced_commit":"0a7c469b716e75b223103ca1444d82e7b583a071"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaliborc%2Faction-general-autotag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaliborc%2Faction-general-autotag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaliborc%2Faction-general-autotag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaliborc%2Faction-general-autotag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jaliborc","download_url":"https://codeload.github.com/Jaliborc/action-general-autotag/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248482924,"owners_count":21111401,"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":["action","automation","autotag","github-actions","node","nodejs","package","tag"],"created_at":"2024-09-24T14:12:09.344Z","updated_at":"2025-04-11T21:31:13.602Z","avatar_url":"https://github.com/Jaliborc.png","language":"JavaScript","funding_links":["https://patreon.com/jaliborc"],"categories":[],"sub_categories":[],"readme":"# General AutoTag :bookmark_tabs:\n[![](https://img.shields.io/npm/v/general-autotag.svg)](https://www.npmjs.com/package/general-autotag) [![](https://github.com/jaliborc/scrap/workflows/tag/badge.svg)](https://github.com/jaliborc/scrap/actions) ![](https://david-dm.org/jaliborc/general-autotag.svg) ![](https://img.shields.io/npm/l/general-autotag.svg)\n\nThis action will read a chosen source file and extract the current version from it. It will then compare it to the project's known tags and, if a corresponding tag does not exist, it will be created.\n\nForked from [Autotag](https://github.com/ButlerLogic/action-autotag), which worked specifically with Node projects. This approach is more flexible and works with different programming languages.\n\n## Usage\n\nThe following is an example `.github/main.workflow` that will execute when a `push` to the `master` branch occurs. It will extract the current version number from `package.json`:\n\n```yaml\nname: My Workflow\n\non:\n  push:\n    paths:\n    - package.json\n    branches:\n    - master\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@master\n    - uses: jaliborc/action-general-autotag@1.0.0\n      with:\n        GITHUB_TOKEN: \"${{ secrets.GITHUB_TOKEN }}\"\n        source_file: \"package.json\"\n        extraction_regex: \"\\\\s*\\\"version\\\"s*:\\\\s*\\\"([\\\\d\\\\.]+)\\\"\"\n```\n\nTo make this work, the workflow must have the checkout action _before_ the tagging action.\n\nThis **order** is important!\n\n```yaml\n- uses: actions/checkout@master\n- uses: jaliborc/action-general-autotag@1.0.0\n```\n\n\u003e If the repository is not checked out first, the action cannot find the chosen source file.\n\n## Configuration\n### Mandatory\n\nThe `GITHUB_TOKEN`, a `source_file` and an `extraction_regex` must be passed in. Without this, it is not possible to create a new tag. Make sure the autotag action looks like the following example:\n\n```yaml\n- uses: jaliborc/action-general-autotag@1.0.0\n  with:\n    GITHUB_TOKEN: \"${{ secrets.GITHUB_TOKEN }}\"\n    source_file: # the file in your repository that contains the version name\n    extraction_regex: # some regex pattern\n```\n\nThe action will automatically extract the github token at runtime. **DO NOT MANUALLY ENTER YOUR TOKEN.** If you put the actual token in your workflow file, you're make it accessible in plaintext to anyone who ever views the repository (it will be in your git history).\n\n### Optional\nThere are a few options to customize how the tag is created.\n\n1. `tag_format`\n\n    By default, the action will tag versions exactly as matched in the source file. Prefixes and suffixes can be used to add text around the tag name. For example, if the current version is `1.0.0` and the `tag_format` is set to `v{version} (beta)`, then the tag would be labeled as `v1.0.0 (beta)`.\n\n    ```yaml\n    - uses: jaliborc/action-general-autotag@1.0.0\n      with:\n        GITHUB_TOKEN: \"${{ secrets.GITHUB_TOKEN }}\"\n        source_file: \"package.json\"\n        extraction_regex: \"(\\\\d+\\\\.\\\\d+\\\\.\\\\d+)\"\n        tag_format: \"v{version} (beta)\"\n    ```\n\n1. `tag_message`\n\n    This is the annotated commit message associated with the tag. By default, a changelog will be generated from the commits between the latest tag and the new tag (HEAD). This will override that with a hard-coded message.\n\n    ```yaml\n    - uses: jaliborc/action-general-autotag@1.0.0\n      with:\n        GITHUB_TOKEN: \"${{ secrets.GITHUB_TOKEN }}\"\n        source_file: \"project.toc\"\n        extraction_regex: \"Version:\\\\s*(\\\\d+)\"\n        tag_message: \"Custom message goes here.\"\n    ```\n\n## Output\nIf you are building an action that runs after this one, be aware this action produces several [outputs](https://help.github.com/en/articles/metadata-syntax-for-github-actions#outputs):\n\n1. `tagname` will be empty if no tag was created, or it will be the value of the new tag.\n1. `tagsha`: The SHA of the new tag.\n1. `taguri`: The URI/URL of the new tag reference.\n1. `tagmessage`: The message applied to the tag reference (this is what shows up on the tag screen on GitHub).\n1. `version` will be the version attribute found in the chosen source file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaliborc%2Faction-general-autotag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaliborc%2Faction-general-autotag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaliborc%2Faction-general-autotag/lists"}