-
-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for release event (Github, Gitea, Gitlab) #764
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
Codecov Report
@@ Coverage Diff @@
## master #764 +/- ##
==========================================
+ Coverage 51.58% 52.24% +0.66%
==========================================
Files 79 79
Lines 6074 6203 +129
==========================================
+ Hits 3133 3241 +108
- Misses 2760 2776 +16
- Partials 181 186 +5
Continue to review full report at Codecov.
|
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: 6543 <6543@obermui.de>
@@ -523,13 +524,17 @@ func (g *Gitlab) Hook(ctx context.Context, req *http.Request) (*model.Repo, *mod | |||
return nil, nil, err | |||
} | |||
|
|||
parsed, err := gitlab.ParseWebhook(gitlab.WebhookEventType(req), payload) | |||
gitlabEventType := gitlab.WebhookEventType(req) | |||
println("Received event: " + gitlabEventType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we do use zerolog ;)
@@ -267,13 +268,19 @@ func setupGitlab(c *cli.Context) (remote.Remote, error) { | |||
|
|||
// helper function to setup the GitHub remote from the CLI arguments. | |||
func setupGithub(c *cli.Context) (remote.Remote, error) { | |||
releaseActions := regexp. | |||
MustCompile(`[\s,]+`). | |||
Split(c.String("github-release-actions"), -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use c.Strings
Deployment of preview was successful: https://woodpecker-ci-woodpecker-pr-764.surge.sh |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
We should apply #917 here too if there's no branch associated, but actually releases can have branches that should be parsed here. |
&cli.StringFlag{ | ||
EnvVars: []string{"WOODPECKER_GITHUB_RELEASE_ACTIONS"}, | ||
Name: "github-release-actions", | ||
Usage: "On which actions to trigger a release pipeline", | ||
Value: "prereleased, released", | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of limiting here I would suggest to inject an environment variable to each step CI_RELEASE_TYPE=draft,pre-release,release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And adding some filter to the when
options would be good too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this could be pretty simple by introducing #312
-> #3226 |
Supersedes woodpecker-ci#764 Bitbucket does not support release webhooks. --------- Co-authored-by: Patrick Schratz <patrick.schratz@gmail.com>
As a github developer (both public and Enterprise) I would like to be able to catch and run CI on the release event, allowing to add artifacts for release via the github GUI.
Reasons:
Changes: