generated from mintlify/starter
-
Notifications
You must be signed in to change notification settings - Fork 306
50 lines (42 loc) · 1.23 KB
/
snippets.yaml
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
43
44
45
46
47
48
49
50
name: Create OpenAPI with Snippets
on:
workflow_dispatch:
inputs:
pr_title:
description: 'Pull Request Title'
required: true
default: '[Automated] Update OpenAPI Spec'
pr_body:
description: 'Pull Request Body'
required: true
default: 'This is an automated pull request to update the OpenAPI specification.'
env:
FERN_API_KEY: ${{ secrets.FERN_API_KEY }}
GITHUB_TOKEN: ${{ secrets.WRITE_GITHUB }}
permissions:
contents: write
pull-requests: write
jobs:
run-snippets:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Create env file
run: |
touch .env
echo FERN_API_KEY=${{ secrets.FERN_API_KEY }} >> .env
- name: Run snippets.js
run: node .github/workflows/snippets.js
- name: Commit OpenAPI Spec
uses: EndBug/add-and-commit@v9
with:
add: 'openapi.json'
author_name: GitHub Action
author_email: actions@github.com
message: 'Update OpenAPI specification'
push: 'origin main --force'