-
Notifications
You must be signed in to change notification settings - Fork 9
42 lines (39 loc) · 1.52 KB
/
generate-openapi.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: generate-openapi
on:
# Triggered weekly or manually in https://github.com/oasisprotocol/explorer/actions/workflows/generate-openapi.yml
workflow_dispatch:
schedule:
- cron: '0 0 * * 1'
jobs:
generate-openapi:
if: github.repository == 'oasisprotocol/explorer' # Disable cronjob on forks
runs-on: ubuntu-latest
permissions: # Limit secrets.GITHUB_TOKEN permissions
contents: write
pull-requests: write
defaults:
run:
working-directory: src/oasis-nexus
steps:
- uses: actions/checkout@v4
- name: Set up Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: yarn
cache-dependency-path: src/oasis-nexus/yarn.lock
- run: yarn install --frozen-lockfile
- run: yarn generate
- name: Create Pull Request with updated API bindings
# https://github.com/peter-evans/create-pull-request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
branch: generate-openapi
commit-message: 'Update API bindings'
title: 'Update API bindings'
body: |
Created by https://github.com/oasisprotocol/explorer/blob/master/.github/workflows/generate-openapi.yml
If CI actions and checks don't run in this PR: close it and reopen.
https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs
labels: bot