• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

README.mdH A D06-Sep-2019999

contributing.jsonH A D06-Sep-20191.1 KiB

go.modH A D06-Sep-201957

main.goH A D06-Sep-20191.8 KiB

README.md

1# Github Release Check
2
3This is a simple Go lib to handle updates. Small and easy to use lib.
4
5``` sh
6go get github.com/yitsushi/github-release-check
7```
8
9### Sample code
10
11``` go
12package main
13
14import GRC "github.com/yitsushi/github-release-check"
15import "fmt"
16
17const (
18  RepoOwner string = "yitsushi"
19  RepoName  string = "Server-For-React"
20  Version   string = "v1.0"
21)
22
23func main() {
24  needUpdate, releaseInfo, err := GRC.Check(RepoOwner, RepoName, Version)
25
26  if err != nil {
27    panic(err)
28  }
29
30  if needUpdate {
31    fmt.Printf("Please update from %s to %s at %s", Version, releaseInfo.TagName, releaseInfo.HTMLURL)
32  } else {
33    fmt.Println("Application status: Up to date.")
34  }
35}
36```
37
38It does not return with the full [Release response object](https://developer.github.com/v3/repos/releases/)
39but only with useful fields that related to an application update request.
40
41### Why release?
42
43Because I need to test the API Endpoint somewhere and why not with the same repo. So nothing more (yet)
44