Update OAS #13
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
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 }} |