Skip to content

Commit

Permalink
Refresh update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ichizok committed Jan 9, 2024
1 parent 5ea3e41 commit 1b21a81
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 21 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,32 @@ on:
schedule:
- cron: '30 0 * * *'
# - cron: '*/5 * * * *'

jobs:
build:
runs-on: ubuntu-latest
name: run
steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: 'gh-pages'

- name: Golang Action
uses: cedrickring/[email protected]

- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- name: Update redirects
run: make

- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
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'
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -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
)
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=

0 comments on commit 1b21a81

Please sign in to comment.