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?
d1wilko
(Dan Wilson)
January 5, 2023, 9:39am
2
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
Joao_Alves
(João Alves)
January 5, 2023, 11:44am
3
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.
d1wilko
(Dan Wilson)
January 5, 2023, 11:56am
4
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.
d1wilko
(Dan Wilson)
January 5, 2023, 1:32pm
6
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