Skip to content

Commit

Permalink
chore: poll OpenAPI spec and add PR
Browse files Browse the repository at this point in the history
  • Loading branch information
leggetter authored Jun 14, 2024
1 parent b3e15da commit 43b6658
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/poll-openapi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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."

0 comments on commit 43b6658

Please sign in to comment.