Update schema #762
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update schema | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '36 7 * * *' | |
jobs: | |
update-schema: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: tibdex/github-app-token@v1 | |
id: generate-token | |
with: | |
app_id: ${{ secrets.APP_ID }} | |
private_key: ${{ secrets.APP_PRIVATE_KEY }} | |
- name: Checkout latest code | |
uses: actions/checkout@v3.6.0 | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.19 | |
- name: Get Go environment | |
id: go-env | |
run: | | |
echo "::set-output name=cache::$(go env GOCACHE)" | |
echo "::set-output name=modcache::$(go env GOMODCACHE)" | |
- name: Set up cache | |
uses: actions/cache@v3.3.2 | |
with: | |
path: | | |
${{ steps.go-env.outputs.cache }} | |
${{ steps.go-env.outputs.modcache }} | |
key: update-schema-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
update-schema-${{ runner.os }}-go- | |
- name: Update schema & generate files | |
run: make generate | |
- name: Create PR | |
id: cpr | |
uses: peter-evans/create-pull-request@v5.0.2 | |
with: | |
author: GitHub <actions@github.com> | |
committer: GitHub <actions@github.com> | |
commit-message: 'feat(oas): update BotAPI schema' | |
branch: feat/update-schema | |
delete-branch: true | |
token: ${{ steps.generate-token.outputs.token }} | |
title: Update Bot API schema to the latest version | |
body: | | |
Update Bot API schema to the latest version. | |
labels: | | |
dependencies |