Skip to content

Delete latest release

Actions
Delete latest release
v2
Latest
Star (6)

⚠ 【Action Deprecated】

❤ Use github-script instead.

    steps:
      - uses: actions/github-script@v4
        with:
          github-token: ${{secrets.GITHUB_TOKEN}}
          script: |
            const { owner, repo } = context.repo
            const { data: { id } } = await github.repos.getLatestRelease({ owner, repo })
            await github.repos.deleteRelease({ owner, repo, release_id: id })

In most cases, that way meet your needs better.

more info, check https://github.com/actions/github-script

不再推荐使用这个Action,大部分情况github-script同样能做到且更加灵活。

Example

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Delete
        uses: ame-yu/action-delete-latest-release@v2
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}

      - name: Release
        uses: softprops/action-gh-release@v1
        with:
          name: type-your-release-name
          tag_name: tag-here

Inputs

name value default description
github_token string Token for the repo. Can be passed in using ${{ secrets.GITHUB_TOKEN }}.
repository string '' Repository name. Default or empty repository name represents current github repository.

Delete latest release is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Delete latest release
v2
Latest

Delete latest release is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.