Skip to content

Instantly share code, notes, and snippets.

@khanhicetea
Created August 14, 2017 05:39
Show Gist options
  • Save khanhicetea/c9fddf9bd0b883026fafb54bfe63982e to your computer and use it in GitHub Desktop.
Save khanhicetea/c9fddf9bd0b883026fafb54bfe63982e to your computer and use it in GitHub Desktop.
Drone webhook access token generator (version 0.4.0)
package main
import (
"fmt"
"github.com/drone/drone/shared/token"
)
func main() {
repo_hash := "[SELECT `repo_hash` FROM `repos` where `repo_full_name` = <YOUR_REPO_FULLNAME>]"
repo_fullname := "<YOUR_REPO_FULLNAME>"
t := token.New(token.HookToken, repo_fullname)
sig, err := t.Sign(repo_hash)
if err != nil {
fmt.Println("error !")
}
fmt.Println(sig)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment