-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
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
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." |