Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

ame-yu/action-delete-latest-release

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠ 【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.