-
Notifications
You must be signed in to change notification settings - Fork 15
47 lines (45 loc) · 1.75 KB
/
update-api-specs.yaml
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
43
44
45
46
47
name: Update API specs
on:
workflow_dispatch:
# Run daily after midnight UTC
schedule:
- cron: '0 1 * * *'
jobs:
update-api-specs:
runs-on: ubuntu-24.04
steps:
- name: Check out repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- name: Determine base version
id: base_version
run: |
echo "value=$(cat .base_version)" >> "$GITHUB_OUTPUT"
- name: Set up Anbox Cloud
uses: canonical/anbox-cloud-github-action@118f33a9d428f1a42940333fad8ff108be757908
with:
channel: ${{ steps.base_version.outputs.value }}/stable
- name: Determine appliance version
id: snap_version
run: |
echo "value=$(snap info anbox-cloud-appliance | awk '/installed/{print $2}')" >> "$GITHUB_OUTPUT"
- name: Extract API spec from AMS
run: |
sudo apt update
sudo apt install -y jq yq
curl \
--unix-socket /var/snap/anbox-cloud-appliance/common/ams-unix.socket \
s/1.0/swagger.json | yq -y > ./reference/api-reference/ams-api.yaml
- name: Create PR
uses: canonical/create-pull-request@8f6ac18065716982f3970ef7d6d584bed1b4cbe3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "feat: update API specs from ${{ steps.snap_version.outputs.value }}"
branch-name: new-branch
title: Update API specs from ${{ steps.snap_version.outputs.value }}
body: |
This updates the AMS API specification as taken from the `anbox-cloud-appliance` as of
version ${{ steps.snap_version.outputs.value }}.
You have to close and reopen the PR to trigger checks.
repository: canonical/anbox-cloud-docs
upsert: true
ignore-no-changes: true