add in snippets updated #7
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: Create OpenAPI with Snippets | |
on: | |
pull_request: | |
branches: | |
- main | |
env: | |
FERN_API_KEY: ${{ secrets.FERN_API_KEY }} | |
permissions: | |
contents: write | |
jobs: | |
run-snippets: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
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 spec from GitHub Actions' | |
push: origin ${{ github.head_ref }} |