{"id":13529719,"url":"https://github.com/author/action-rollback","last_synced_at":"2025-04-06T07:12:33.866Z","repository":{"id":40634056,"uuid":"237030370","full_name":"author/action-rollback","owner":"author","description":"A Github action to rollback/delete a release.","archived":false,"fork":false,"pushed_at":"2025-02-18T23:21:14.000Z","size":2439,"stargazers_count":57,"open_issues_count":5,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T06:05:39.591Z","etag":null,"topics":[],"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/author.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":{"github":"coreybutler","patreon":"coreybutler","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-01-29T16:32:24.000Z","updated_at":"2024-12-24T15:51:37.000Z","dependencies_parsed_at":"2024-03-08T21:26:17.283Z","dependency_job_id":"c85dc280-a8b3-41e6-ab14-72ee798b535f","html_url":"https://github.com/author/action-rollback","commit_stats":{"total_commits":68,"total_committers":4,"mean_commits":17.0,"dds":"0.11764705882352944","last_synced_commit":"f4473931b1155b601092ec00eb1fa4882b80219f"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/author%2Faction-rollback","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/author%2Faction-rollback/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/author%2Faction-rollback/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/author%2Faction-rollback/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/author","download_url":"https://codeload.github.com/author/action-rollback/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247445671,"owners_count":20939958,"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-08-01T07:00:38.788Z","updated_at":"2025-04-06T07:12:33.843Z","avatar_url":"https://github.com/author.png","language":"JavaScript","funding_links":["https://github.com/sponsors/coreybutler","https://patreon.com/coreybutler"],"categories":["Community Resources"],"sub_categories":["GitHub Tools and Management"],"readme":"# author/action-rollback\n\nThis action will rollback/delete a Github release. It is designed as a failsafe for workflows that do not complete, produce errors, fail to publish, or any other circumstance where removing a release is applicable.\n\nFor example, consider the lifecycle of a Javascript package being published to npm.\n\n`test--\u003ebuild--\u003etag--\u003erelease--\u003epublish`\n\nIn the scenario where publishing fails, it may be desirable to rollback the release.\n\n## Workflow\n\nThe following is an example `.github/publish.yml` that will rollback a release when a publish fails.\n\nConfiguring the action is straightforward:\n\n```yaml\n- name: Rollback Release\n  if: failure()\n  uses: author/action-rollback@stable\n  with:\n    # Using a known release ID\n    release_id: ${{ steps.create_release.id }}\n    # Using a tag name\n    tag: 'v1.0.1'\n    #  If the release does not exist but the tag does, setting this to true will remove the tag.\n    delete_orphan_tag: true\n  env:\n    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\nIt's a bit easier to understand in context of a complete workflow:\n\n```yaml\nname: Publish\n\non:\n  push:\n    branches:\n      - master\n\npermissions:           # You may need this permission for removing old releases\n  contents: write\n\njobs:\n  publish:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Tag\n        id: autotagger\n        uses: butlerlogic/action-autotag@stable\n        with:\n          GITHUB_TOKEN: \"${{ secrets.GITHUB_TOKEN }}\"\n      \n      - name: Release\n        id: create_release\n        if: steps.autotagger.outputs.tagname != ''\n        uses: actions/create-release@v1.0.0\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        with:\n          tag_name: ${{ steps.autotagger.outputs.tagname }}\n          release_name: Version ${{ steps.autotagger.outputs.version }}\n          body: ${{ steps.autotagger.outputs.tagmessage }}\n          draft: false\n          prerelease: true\n\n      - name: Publish\n        id: publish_npm\n        if: steps.autotagger.outputs.tagname != ''\n        uses: author/action-publish@stable\n        env:\n          REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}\n\n      - name: Rollback Release\n        if: failure() \u0026\u0026 steps.create_release.outputs.id != ''\n        uses: author/action-rollback@stable\n        with:\n          # Using a known release ID\n          id: ${{ steps.create_release.id }}\n          # Using a tag name\n          tag: ${{ steps.autotagger.outputs.tagname }}\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\nOnly the `id` _**or**_ `tag` need to be specified. If a publish fails, the release will be removed.\n\n### What is the purpose of `delete_orphan_tag`?\n\nIt's a way to clean up messy processes.\n\nIt may seem unnecessary at first. However; it is useful when a release is removed through other means, leaving an orphan tag.\n\nTechnically, this attribute could be used if you only need to rollback tags of any kind (regardless of whether a release exists).\n\n---\n## Credits\n\nThis action was written and is primarily maintained by [Corey Butler](https://github.com/coreybutler).\n\n# Our Ask...\n\nIf you use this or find value in it, please consider contributing in one or more of the following ways:\n\n1. Click the \"Sponsor\" button at the top of the page.\n1. Star it!\n1. [Tweet about it!](https://twitter.com/intent/tweet?hashtags=github,actions\u0026original_referer=http%3A%2F%2F127.0.0.1%3A91%2F\u0026text=I%20am%20automating%20my%20workflow%20with%20the%20Multipublisher%20Github%20action!\u0026tw_p=tweetbutton\u0026url=https%3A%2F%2Fgithub.com%2Fauthor%2Faction%2Fpublish\u0026via=goldglovecb)\n1. Fix an issue.\n1. Add a feature (post a proposal in an issue first!).\n\nCopyright \u0026copy; 2020 Author.io, Corey Butler, and Contributors.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauthor%2Faction-rollback","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fauthor%2Faction-rollback","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauthor%2Faction-rollback/lists"}