{"id":20849463,"url":"https://github.com/sillyhatxu/learning-github-actions","last_synced_at":"2026-04-19T16:32:25.047Z","repository":{"id":57537091,"uuid":"284729883","full_name":"sillyhatxu/learning-github-actions","owner":"sillyhatxu","description":"A simple tutorial for Actions and Budges","archived":false,"fork":false,"pushed_at":"2020-08-05T12:57:02.000Z","size":996,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-28T02:51:08.780Z","etag":null,"topics":["actions","budge","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sillyhatxu.png","metadata":{"files":{"readme":"README-zh.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-03T15:00:20.000Z","updated_at":"2020-08-05T12:57:04.000Z","dependencies_parsed_at":"2022-08-29T00:31:19.565Z","dependency_job_id":null,"html_url":"https://github.com/sillyhatxu/learning-github-actions","commit_stats":null,"previous_names":["sillyhatxu/learning-github-action"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/sillyhatxu/learning-github-actions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sillyhatxu%2Flearning-github-actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sillyhatxu%2Flearning-github-actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sillyhatxu%2Flearning-github-actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sillyhatxu%2Flearning-github-actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sillyhatxu","download_url":"https://codeload.github.com/sillyhatxu/learning-github-actions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sillyhatxu%2Flearning-github-actions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28909008,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T06:42:00.998Z","status":"ssl_error","status_checked_at":"2026-01-30T06:41:58.659Z","response_time":66,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","budge","go","golang"],"created_at":"2024-11-18T03:05:14.419Z","updated_at":"2026-01-30T08:10:31.643Z","avatar_url":"https://github.com/sillyhatxu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# learning-github-actions\n\n[![made-with-Go](https://img.shields.io/badge/Made%20with-Go-1f425f.svg)](http://golang.org)\n[![Go-Version](https://img.shields.io/github/go-mod/go-version/gomods/athens.svg)](https://github.com/sillyhatxu/learning-github-actions)\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/sillyhatxu/learning-github-actions)](https://pkg.go.dev/github.com/sillyhatxu/learning-github-actions)\n[![Build and Test](https://github.com/sillyhatxu/learning-github-actions/workflows/Build%20and%20Test/badge.svg?branch=master\u0026event=push)](https://github.com/sillyhatxu/learning-github-actions/actions)\n[![Go Report Card](https://goreportcard.com/badge/github.com/sillyhatxu/learning-github-actions)](https://goreportcard.com/report/github.com/sillyhatxu/learning-github-actions)\n[![codecov](https://codecov.io/gh/sillyhatxu/learning-github-actions/branch/master/graph/badge.svg)](https://codecov.io/gh/sillyhatxu/learning-github-actions)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://choosealicense.com/licenses/mit/)\n[![Release](https://img.shields.io/github/release/sillyhatxu/learning-github-actions.svg?style=flat-square)](https://github.com/sillyhatxu/learning-github-actions/releases)\n\n## 1. 新增workflows\n\n新增文件 `.github/workflows/master.yml`\n\n\u003e 创建后，系统会在Actions中显示build\n\n1) 直接创建\n\n```yaml\nname: Build and Test\n\non:\n  push:\n    branches: [ master ]\n\njobs:\n\n  build:\n    name: Build\n    runs-on: ubuntu-latest\n    steps:\n\n      - name: Set up Go 1.x\n        uses: actions/setup-go@v2\n        with:\n          go-version: ^1.14\n        id: go\n\n      - name: Check out code into the Go module directory\n        uses: actions/checkout@v2\n\n      - name: Get dependencies\n        run: go mod vendor\n\n      - name: Test\n        run: go test -v .\n\n# If it does not has the main function and doesn't need to build.\n#      - name: Build\n#        run: go build -v .\n```\n\n2) 页面操作新增文件\n\n* page 1\n\n![](https://github.com/sillyhatxu/learning-github-actions/blob/master/asset/page-add-workflows-01.png)\n\n* page 2\n\n![](https://github.com/sillyhatxu/learning-github-actions/blob/master/asset/page-add-workflows-02.png)\n\n* page 3\n\n![](https://github.com/sillyhatxu/learning-github-actions/blob/master/asset/page-add-workflows-03.png)\n\n\n## 2. 添加 badges\n\n### 1) 添加 Made with Go\n\n```yaml\n[![made-with-Go](https://img.shields.io/badge/Made%20with-Go-1f425f.svg)](http://golang.org)\n```\n\n### 2) 添加 Go Version\n\n```yaml\n[![Go-Version](https://img.shields.io/github/go-mod/go-version/gomods/athens.svg)](https://github.com/\u003cOWNER\u003e/\u003cREPOSITORY\u003e)\n```\n\n### 4) 添加 Go Reference\n\n*需要创建License*\n\n* page 1\n\n![](https://github.com/sillyhatxu/learning-github-actions/blob/master/asset/create-license-01.png)\n\n* page 2\n\n![](https://github.com/sillyhatxu/learning-github-actions/blob/master/asset/create-license-02.png)\n\n* page 3\n\n![](https://github.com/sillyhatxu/learning-github-actions/blob/master/asset/create-license-03.png)\n\n* page 4\n\n![](https://github.com/sillyhatxu/learning-github-actions/blob/master/asset/create-license-04.png)\n\n\u003e 有时不会自动创建，官方给出两种解决方案。\n\n* 第一种：`不知名原因，只返回了json，但没有更新Go Reference Doc`\n\n\u003e Making a request to proxy.golang.org for the module version, to any endpoint specified by the Module proxy protocol. \n\u003e For example: https://proxy.golang.org/example.com/my/module/@v/v1.0.0.info\n\n    curl https://proxy.golang.org/github.com/sillyhatxu/learning-github-actions/@latest\n    {\"Version\":\"v1.0.0\",\"Time\":\"2020-08-04T15:50:54Z\"}\n    curl https://proxy.golang.org/github.com/sillyhatxu/learning-github-actions/@v/v1.0.0.info\n    {\"Version\":\"v1.0.0\",\"Time\":\"2020-08-04T15:50:54Z\"}\n\n* 第二种：`需要使用另一个golang的项目，在go mod init 后，使用 go get 命令来发布`\n\u003e Downloading the package via the go command. \n\u003e For example: GOPROXY=https://proxy.golang.org GO111MODULE=on \n\u003e go get example.com/my/module@v1.0.0\n    \n    create new project xxxxxx\n    go mod init xxxxxx\n    go get github.com/sillyhatxu/learning-github-actions/@v1.0.2\n\n```yaml\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/\u003cOWNER\u003e/\u003cREPOSITORY\u003e)](https://pkg.go.dev/github.com/\u003cOWNER\u003e/\u003cREPOSITORY\u003e)\n```\n\n### 4) 添加 build and test badge\n\n```yaml\n[![Build and Test](https://github.com/sillyhatxu/learning-github-actions/workflows/Build%20and%20Test/badge.svg?branch=master\u0026event=push)](https://github.com/sillyhatxu/learning-github-actions/actions)\n```\n\n![](https://github.com/sillyhatxu/learning-github-actions/blob/master/asset/workflow-name.png)\n\n### 5) 添加 coverage badge\n\n* 登陆 [codecov](https://codecov.io/)\n* Add new repository\n\n![](https://github.com/sillyhatxu/learning-github-actions/blob/master/asset/create-coverage-01.png)\n\n* Choose a new repository below\n\n![](https://github.com/sillyhatxu/learning-github-actions/blob/master/asset/create-coverage-02.png)\n\n* Copy token\n\n![](https://github.com/sillyhatxu/learning-github-actions/blob/master/asset/create-coverage-03.png)\n\n* 回到Github `project-\u003eSettings-\u003eSecrets-\u003eNew Secret`\n\n![](https://github.com/sillyhatxu/learning-github-actions/blob/master/asset/create-coverage-04.png)\n\n* Create Secret `CODECOV_TOKEN=xxxxx` paste codecov token\n\n![](https://github.com/sillyhatxu/learning-github-actions/blob/master/asset/create-coverage-05.png)\n\n* Create workflows `coverage.yml`\n\n```yaml\nname: Coverage\n\non:\n  push:\n    branches: [ master ]\n\njobs:\n\n  build:\n    name: Build\n    runs-on: ubuntu-latest\n    steps:\n\n      - name: Set up Go 1.x\n        uses: actions/setup-go@v2\n        with:\n          go-version: ^1.14\n        id: go\n\n      - name: Check out code into the Go module directory\n        uses: actions/checkout@v2\n\n      - name: Get dependencies\n        run: go mod vendor\n\n      - name: Create coverage file\n        run: |\n          set -e\n          echo \"\" \u003e coverage.txt\n\n          for d in $(go list ./... | grep -v vendor); do\n              go test -race -coverprofile=profile.out -covermode=atomic \"$d\"\n              if [ -f profile.out ]; then\n                  cat profile.out \u003e\u003e coverage.txt\n                  rm profile.out\n              fi\n          done\n\n      - name: Coverage\n        run: bash \u003c(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }}\n```\n\n### 6) 添加 go report\n\n```yaml\n[![Go Report Card](https://goreportcard.com/badge/github.com/\u003cOWNER\u003e/\u003cREPOSITORY\u003e)](https://goreportcard.com/report/github.com/\u003cOWNER\u003e/\u003cREPOSITORY\u003e)\n```\n\n### 7) 添加 release version\n\n```yaml\n[![Release](https://img.shields.io/github/release/\u003cOWNER\u003e/\u003cREPOSITORY\u003e.svg?style=flat-square)](https://github.com/\u003cOWNER\u003e/\u003cREPOSITORY\u003e/releases)\n```\n\n### 8) 添加 MIT License\n\n```yaml\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://choosealicense.com/licenses/mit/)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsillyhatxu%2Flearning-github-actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsillyhatxu%2Flearning-github-actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsillyhatxu%2Flearning-github-actions/lists"}