Skip to content

generate-openapi

generate-openapi #100

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@v6
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