From cef9410248c8d47857ff3eceafbacdb5e3e5c23f Mon Sep 17 00:00:00 2001 From: ichizok Date: Fri, 7 Apr 2023 19:24:37 +0900 Subject: [PATCH] Refresh update workflow --- .github/workflows/main.yml | 25 +++++++++++++------------ Makefile | 2 -- README.md | 8 +------- go.mod | 8 ++++++++ go.sum | 6 ++++++ 5 files changed, 28 insertions(+), 21 deletions(-) create mode 100644 go.mod create mode 100644 go.sum diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6a7f7921..d39d61ce 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,18 +4,25 @@ on: schedule: - cron: '30 0 * * *' # - cron: '*/5 * * * *' + jobs: build: runs-on: ubuntu-latest name: run steps: - - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v3 with: ref: 'gh-pages' - - name: Golang Action - uses: cedrickring/golang-action@1.4.1 - + - name: Setup Golang + uses: actions/setup-go@v4 + with: + go-version-file: 'go.mod' + + - name: Update redirects + run: make + - name: Commit files run: | git config --local user.email "redirects-action@vim-jp.org" @@ -23,12 +30,6 @@ jobs: git add --update if ! git diff --quiet HEAD ; then DATE=$(date "+%Y/%m/%d %H:%M %Z") - git commit -m "Updated by GithubActions at ${DATE}" - git push + git commit -m "Updated by GithubActions at ${DATE}" + git push fi - - # - name: Push changes - # uses: ad-m/github-push-action@master - # with: - # github_token: ${{ secrets.GITHUB_TOKEN }} - # branch: 'gh-pages' diff --git a/Makefile b/Makefile index 0d1e0908..b3bdc566 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,2 @@ run: - go get -u github.com/koron/go-github - go get -u gopkg.in/yaml.v2 go run _scripts/vim_jp-redirects-update/main.go diff --git a/README.md b/README.md index 78aa99f5..52a63122 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,7 @@ ### Pre requirements * of course checkout this [vim-jp/redirects][1] repo -* [go 1.5.3 or above (1.6 is recommended)][2] -* golang external packages - - ``` - $ go get -u github.com/koron/go-github - $ go get -u gopkg.in/yaml.v2 - ``` +* [go 1.16 or above][2] ### Update redirects diff --git a/go.mod b/go.mod new file mode 100644 index 00000000..a11826d4 --- /dev/null +++ b/go.mod @@ -0,0 +1,8 @@ +module github.com/vim-jp/redirects + +go 1.16 + +require ( + github.com/koron/go-github v0.0.0-20160618135937-92fbbed2e046 + gopkg.in/yaml.v2 v2.4.0 +) diff --git a/go.sum b/go.sum new file mode 100644 index 00000000..c67ded27 --- /dev/null +++ b/go.sum @@ -0,0 +1,6 @@ +github.com/koron/go-github v0.0.0-20160618135937-92fbbed2e046 h1:YjgY0oqB2nqyVckaRdLhOGslSgcsy0+DlSczAZpPPlM= +github.com/koron/go-github v0.0.0-20160618135937-92fbbed2e046/go.mod h1:14+A+rOS/yG6PtS3DKcRYYM9tP0+zVghPxIzqOYBXks= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=