Skip to content

Commit 24e79f9

Browse files
committed
ci: autoupdate a generated code
The patch adds a scheduled job [1] that creates or update [2] a pull request every day if a generated code have been changed. 1. https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onschedule 2. https://github.com/marketplace/actions/create-pull-request Closes #506
1 parent d4c6b0b commit 24e79f9

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/update.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: update
2+
3+
on:
4+
schedule:
5+
# The job starts every day at 00:00 UTC. See:
6+
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
7+
- cron: '0 0 * * *'
8+
workflow_dispatch:
9+
10+
env:
11+
GO_VERSION: '1.20'
12+
13+
jobs:
14+
update:
15+
runs-on: ubuntu-20.04
16+
steps:
17+
- uses: actions/checkout@master
18+
19+
- name: Setup Go
20+
uses: actions/setup-go@v2
21+
with:
22+
go-version: '${{ env.GO_VERSION }}'
23+
24+
- name: Setup Tarantool master
25+
run: |
26+
curl -L https://tarantool.io/release/2/installer.sh | sudo bash
27+
sudo apt install -y tt
28+
mkdir /tmp/tt
29+
cd /tmp/tt
30+
tt init
31+
tt install tarantool master
32+
echo "/tmp/tt/bin" >> $GITHUB_PATH
33+
34+
- name: Setup dependencies for the code generation
35+
run: |
36+
go install github.com/magefile/mage@latest
37+
go install golang.org/x/tools/cmd/goimports@latest
38+
39+
- name: Generate code
40+
run: mage generate
41+
42+
- name: Create Pull Request
43+
uses: peter-evans/create-pull-request@v5
44+
with:
45+
author: 'TarantoolBot <[email protected]>'
46+
body: 'Automated changes by [update](https://github.com/tarantool/tt/blob/master/.github/workflows/update.yml) job.'
47+
branch: 'github-actions/update'
48+
commit-message: 'generate: autoupdate'
49+
committer: 'TarantoolBot <[email protected]>'
50+
title: 'generate: autoupdate'
51+
token: '${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}'

0 commit comments

Comments
 (0)