Drone plugin: drone-github-release

I’m using in .drone.yml

kind: pipeline
type: docker
name: Build and Release Artifacts

steps:
- name: frontend
  image: node
  commands:
  - npm install
  - npm run build
- name: publish
  image: plugins/github-release:latest
#   volumes:
#     - name: output
#       path: /drone/src/output
  settings:
    api_key:
      from_secret: <SECRET>
    files: dist/*
    title: v0.0.1
    checksum:
      - md5
      - sha1
      - sha256
      - sha512
    note: CHANGELOG.md
    event: tag

And receiving this error:

latest: Pulling from plugins/github-release
Digest: sha256:e6c8464739f1148ed7151fe660f6bc68124c8814572f3508f91080301a3dcff8 6s3Status:
Image is up to date for plugins/github-release:latest
6s4time=“2023-01-04T19:32:09Z” level=error msg=“validation failed: github release plugin is only available for tags

How can I resolve this issue?

Hey @Joao_Alves - based on the original docs (drone-plugin-index/original.md at main · drone/drone-plugin-index · GitHub) the pipeline always has a condition that it only runs for tag events

when:
    event: tag

I would guess the scenario you are seeing above is for a push event or something

I will update the plugins site example to include the condition

My scenario is for a push event or something.

  • I just follow the example plugin site
  • Waiting for the update in site example to include the condition.

Thanks.

It’s been updated :wink: Drone Plugins - Github Release

I tried using then when with push or tag, but the error persists:

kind: pipeline
type: docker
name: Build and Release Artifacts

platform:
  os: linux
  arch: amd64

trigger:
  branch:
    - main
#   event:
#     - push
    
steps:
- name: frontend
  image: node
  commands:
    - npm install
    - npm run build
- name: publish
  image: plugins/github-release:latest
#   volumes:
#     - name: output
#       path: /drone/src/output
  settings:
    api_key:
      from_secret: <SECRET>
    files: dist/*
    title: v0.0.1
    checksum:
      - md5
      - sha1
      - sha256
      - sha512
    note: CHANGELOG.md
    prerelease: true
    event:
      - push
#     event: tag
#     when:
#       event: tag
#       status: success
#       ref:
#         include: 
#           - refs/tags/container-*
#         exclude:
#           - refs/tags/**

What are the viable solutions?

Thanks.

It should not work for the push event at all - so I would expect to see the error you mentioned above.

but it should work for the tag event - github releases only work for tags