Fetch Hookdeck OpenAPI #11039
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: Fetch Hookdeck OpenAPI | |
on: | |
workflow_dispatch: # Manually trigger the workflow | |
schedule: | |
- cron: "*/15 * * * *" | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
fetch-openapi: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Fetch OpenAPI | |
run: curl https://api.hookdeck.com/latest/openapi/fern | jq . > fern/openapi/openapi.json | |
- name: Check for Changes | |
id: git-status | |
run: | | |
if [[ -n $(git status --porcelain) ]]; then | |
echo "::set-output name=changed::true" | |
else | |
echo "::set-output name=changed::false" | |
fi | |
- name: Create Pull Request | |
if: steps.git-status.outputs.changed == 'true' | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "Update OpenAPI specification" | |
base: main | |
branch: fern/updateOAS | |
author: GitHub Actions <[email protected]> | |
delete-branch: true | |
title: "Update OpenAPI specification" | |
body: "This PR updates the OpenAPI specification." |