dev-drprasad / delete-tag-and-release Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Warning message during execution:
Node.js 12 actions are deprecated. Please update the following actions to use Node.js 16: dev-drprasad/[email protected]. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.
Please create a new release that contains this fix:
#12
Got warnning from actions: Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. Please update the following actions to use Node.js 16.
Will you consider update it to Node.js 16?
@wardellbagby stated in PR #23
I also want to make a PR that makes it so that every new commit will be forced to run the npm run package script, so that every new commit will always include a new bundle. That'll stop us from ever altering the code without also including a new bundle and make sure that they're always in sync. Alternatively, if we don't want that, I can add a Lint check that simply makes sure that every commit has an updated bundle in it. Or I can do both to be super safe. Would love some thoughts on that.
Hi, I noticed you released v0.2.1 a couple of hours ago. We've been using 0.2.0 in our CI but I guess you deleted this tag after releasing 0.2.1.
It'll be hard for us to update to 0.2.1 all over our repos, any chance you can bring back 0.2.0 as well?
Hello,
I've used the following code to remove the tag nightly
and its release with v0.2.0:
- name: Remove previous tag and release
uses: dev-drprasad/[email protected]
with:
delete_release: true
tag_name: nightly
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
and it worked well - a single release associated with the tag nightly
was removed.
However, after upgrading to v0.2.1, this code removed all the releases that were published under my repository...
Run dev-drprasad/[email protected]
with:
keep_latest: 2
delete_tag_pattern: dev
env:
ARCHIVE_NAME: ccl.zip
CSPROJ_PATH: src\Ccf.Loyalty\Ccf.Loyalty.LocalAgent\Ccf.Loyalty.LocalAgent.csproj
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: true
GitVersion_Major: 0
GitVersion_Minor: 2
GitVersion_Patch: 0
GitVersion_PreReleaseTag: ci-tagging-keep-last-10.1
GitVersion_PreReleaseTagWithDash: -ci-tagging-keep-last-10.1
GitVersion_PreReleaseLabel: ci-tagging-keep-last-10
GitVersion_PreReleaseLabelWithDash: -ci-tagging-keep-last-10
GitVersion_PreReleaseNumber: 1
GitVersion_WeightedPreReleaseNumber: 30001
GitVersion_BuildMetaData: 220
GitVersion_BuildMetaDataPadded: 220
GitVersion_FullBuildMetaData: 220.Branch.feature-ci-tagging-keep-last-10.Sha.d6157befa73725cd0f2b69793e419ee98824589a
GitVersion_MajorMinorPatch: 0.2.0
GitVersion_SemVer: 0.2.0-ci-tagging-keep-last-10.1
GitVersion_LegacySemVer: 0.2.0-ci-tagging-keep-la-1
GitVersion_LegacySemVerPadded: 0.2.0-ci-tagging-keep-la-1
GitVersion_AssemblySemVer: 0.2.0.0
GitVersion_AssemblySemFileVer: 0.2.0.0
GitVersion_FullSemVer: 0.2.0-ci-tagging-keep-last-10.1+220
GitVersion_InformationalVersion: 0.2.0-ci-tagging-keep-last-10.1+220.Branch.feature-ci-tagging-keep-last-10.Sha.d6157befa73725cd0f2b69793e419ee98824589a
GitVersion_BranchName: feature/ci-tagging-keep-last-10
GitVersion_EscapedBranchName: feature-ci-tagging-keep-last-10
GitVersion_Sha: d6157befa73725cd0f2b69793e419ee98824589a
GitVersion_ShortSha: d6157be
GitVersion_NuGetVersionV2: 0.2.0-ci-tagging-keep-la-1
GitVersion_NuGetVersion: 0.2.0-ci-tagging-keep-la-1
GitVersion_NuGetPreReleaseTagV2: ci-tagging-keep-0001
GitVersion_NuGetPreReleaseTag: ci-tagging-keep-0001
GitVersion_VersionSourceSha: fd3d72feab7eb85417583a0aed4e94f97c09ed04
GitVersion_CommitsSinceVersionSource: 220
GitVersion_CommitsSinceVersionSourcePadded: 0220
GitVersion_UncommittedChanges: 0
GitVersion_CommitDate: 2021-07-22
GITHUB_TOKEN: ***
๐ฌ no `repo` name given. fall-ing back to this repo
releases containing dev will be targeted
๐ฌ found total of 3 matching active release(s)
๐ป found 1 older release(s)
starting to delete 0.2.0-dev.207 with id 46577400
๐๐ผ 1 older release(s) deleted successfully!
โ git ls-remote --tags
1dca4fe93d7bc9f2400403942a87534d23bb9790 refs/tags/0.2.0-ci-tagging-keep-last-10.1
2cac7031b4bf1994344bb381d1c595f28da5f7a8 refs/tags/0.2.0-dev.207 <---- this release got removed but tag is not
360917860021f25bc9e6b89fd7442937223bb979 refs/tags/0.2.0-dev.419
1dca4fe93d7bc9f2400403942a87534d23bb9790 refs/tags/0.2.0-dev.638
fd3d72feab7eb85417583a0aed4e94f97c09ed04 refs/tags/v0.1.0
2cac7031b4bf1994344bb381d1c595f28da5f7a8 refs/tags/0.2.0-dev.207 - should be removed.
Run dev-drprasad/[email protected]
๐ท given tag is "v0.5.7"
๐ given repo is "my-org/my-repo"
๐ delete releases is set to "true"
๐ป found 1 releases to delete
Error: ๐ failed to delete release with id "11558844" <- Not Found
What would be missing here?
The release is getting created in same job. Suspecting that might be a problem, I tried to Checkout repository before this stop. Still no avail.
Hey there,
I just tested the action the first time and since I don't like to rely on defaults too much (especially when it comes to deleting stuff) I set delete_release to false.
The release was deleted anyway, I guess because of how the input is tested. This should either be changed by checking the boolean for false or noted in the reamde.
- name: Delete tag
uses: dev-drprasad/[email protected]
with:
delete_release: false
tag_name: ${{ github.event.release.tag_name }}
2020-12-16T21:42:23.7312960Z ##[group]Run dev-drprasad/[email protected]
2020-12-16T21:42:23.7313990Z with:
2020-12-16T21:42:23.7314508Z delete_release: false
2020-12-16T21:42:23.7315081Z tag_name: 3.4.0
2020-12-16T21:42:23.7315530Z env:
2020-12-16T21:42:23.7316608Z GITHUB_TOKEN: ***
2020-12-16T21:42:23.7317126Z ##[endgroup]
2020-12-16T21:42:24.0821696Z ๐ท given tag is "3.4.0"
2020-12-16T21:42:24.2087809Z ๐ป found 1 releases to delete
2020-12-16T21:42:24.5292579Z ๐๐ผ all releases deleted successfully!
2020-12-16T21:42:25.0946827Z โ
3.4.0 deleted successfully!
We create a bunch of releases (temp dev versions) of our open source software, OpenRefine.
See for example: https://github.com/OpenRefine/OpenRefine-nightly-releases/releases
It would be nice to use your action where I can specify the following:
keep:3
to keep the 3 latest releases and it then deletes all the older releases (with their attached tag and binary files), completely removing them.Any chance you could add that option?
Or a brand new action called delete-older-releases
?
I looked around and didn't find something that would work. But pointers welcome.
@wardellbagby stated in PR #23
As an extra, if you all would allow me to, I'll also convert this Action to be in Typescript instead of Javascript to get the benefit of strict typing. However, I acknowledge that Typescript isn't everyone's cup of tea so I'd like some confirmation that that's okay before I do it.
It seems that tag_name
accepts String only.
We wanted to use this Actions to delete multiple tags, but there seems no way (with
can be used only at once I believe).
The solution would be that tag_name
accepts an array or a regex. Using an array might be preferable since it makes implementation simpler.
Hi,
I don't want to discredit anyone's work/effort, but nowadays the github CLI provides an easy way to delete releases.
Therefore, I think this action could be archived/removed since it doesn't add any value anymore.
example with gh cli:
- uses: actions/checkout@v3
- name: Delete Release
run: gh release delete ${{ github.event.inputs.tag }} --cleanup-tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Hello,
by doing a delete and create release, i got a weird behavior, an infinite workflow run happened, do you know why ?
The 2 steps :
- name: Delete previous release
uses: dev-drprasad/[email protected]
with:
tag_name: ${{ github.ref_name }}
github_token: ${{ secrets.token }}
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: weytop-webrtc-tester.deb
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
draft: false
token: ${{ secrets.token }}
target_commitish: ${{ github.ref_name }}
During all night it created 1 workflow run per minute, and for a push event, but i pushed only one time :
Hi ๐ ! I'd like to be able to set the repository from which the tag/release should be deleted.
Overriding it by setting env.GITHUB_REPOSITORY
does not work.
It seems like this variable can not be overridden. Or maybe I'm doing this wrong ๐
I've created this PR in order to solve this ๐ I've made it work on test repositories.
Access rights are not a problem if env.GITHUB_TOKEN
is set with an appropriate personal access token.
Please add a changelog (CHANGELOG.md) and maintain it for future releases.
๐ no releases found associated to tag "unstable"
Run dev-drprasad/[email protected]
๐ท given tag is "unstable"
โ
unstable deleted successfully!
๐ no releases found associated to tag "unstable"
This seems to simply be because it deletes the tag first, which forces the GH release to go back into "draft" mode without any tag association.
I think switching the order of these steps should probably resolve it.
@wardellbagby Let me know in this issue when we might want to do this.
Not an issue, but a proposal. You can avoid a ton of unnecessary code if reuse GitHub Actions programmatic NodeJS API. The example of such JavaScript code can be found in this article https://levelup.gitconnected.com/how-to-move-a-git-tag-using-github-actions-e23a523eb325
You would be able to remove fetch
utility and other boilerplate code
Not a bug, but all previous releases of this package were deleted when v0.2.1 was released, which will cause every workflow that uses this package to break. If there's no option to restore those releases, then this was a pretty frustrating oversight.
Taking GITHUB_TOKEN as a input is a feature available from v1.0, but the example is suggesting v0.2.1 and that expects the token given as an env var.
I thought I saw an issue with Bundle checks or Tests where a workflow step might fail, but it will still pass because we might not be catching it correctly. I could be wrong however and would appreciate help.
plus a lint check that runs in CI so that all new code will have to pass the lint and be properly formatted). Any PR should also include README updates that explain how to contribute to this project and run the tests.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.