-
Notifications
You must be signed in to change notification settings - Fork 3
42 lines (36 loc) · 1.17 KB
/
poll-openapi.yml
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
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."