-
Notifications
You must be signed in to change notification settings - Fork 4
36 lines (30 loc) · 1.26 KB
/
update_oas.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
name: Update OAS
on:
workflow_dispatch:
inputs:
latest-version:
type: string
description: latest stable API version (ex 2023-07)
jobs:
update-oas:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: update OAS
run: python scripts/update_specification_files.py -s api-specifications -g https://api.criteo.com -r ${{ github.event.inputs.latest-version }}
- name: Create new branch and commit files
run: |
git config --global user.name "update-oas-bot"
git config --global user.email "update-oas-bot]@users.noreply.github.com"
git checkout -b update-oas-$(date --rfc-3339=date)
git add *
git commit -m "Update OAS up to ${{ github.event.inputs.latest-version }}"
git push origin update-oas-$(date --rfc-3339=date)
- name: Create pull request on main
run: gh pr create --base main --head update-oas-$(date --rfc-3339=date) --title "Update OAS up to ${{ github.event.inputs.latest-version }}" --body "Update OAS up to ${{ github.event.inputs.latest-version }}"
env:
GH_TOKEN: ${{ github.token }}