Created
August 14, 2017 05:39
-
-
Save khanhicetea/c9fddf9bd0b883026fafb54bfe63982e to your computer and use it in GitHub Desktop.
Drone webhook access token generator (version 0.4.0)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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