Skip to content

Check Open API Framework Version #36

Check Open API Framework Version

Check Open API Framework Version #36

Workflow file for this run

name: open-api-workflow oaf-check
on:
workflow_call:
workflow_dispatch:
jobs:
oaf-up-to-date:
name: Check for new OAF version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
cache: 'pip'
cache-dependency-path: 'requirements/dev.txt'
- name: Install dependencies
run: pip install $(grep "pip-tools==" requirements/dev.txt)
- name: Run compile dependencies
run: ./bin/compile_dependencies.sh --upgrade-package open-api-framework
- name: Check git diff
run: git diff --exit-code -- requirements/*.txt
create-oaf-update-pr:
name: Create a pull requests to update OAF
runs-on: ubuntu-latest
needs: [oaf-up-to-date]
if: failure()
steps:
- uses: actions/checkout@v4
- name: Set up Git
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- uses: actions/setup-python@v5
with:
python-version: 3.11
cache: 'pip'
cache-dependency-path: 'requirements/dev.txt'
- name: Install dependencies
run: pip install $(grep "pip-tools==" requirements/dev.txt)
- name: Run compile dependencies
run: ./bin/compile_dependencies.sh --upgrade-package open-api-framework
- name: Get OAF Version
run: echo "OAF_VERSION=$(grep -Po '(?<=open-api-framework==)[^\n]*' requirements/dev.txt)" >> $GITHUB_ENV
- name: Create and Checkout Branch
run: git checkout -q -B update/open-api-framework-${{env.OAF_VERSION}}
- name: Commit Changes
run: "git commit -i requirements/*.txt -m ':arrow_up: Update Open-API-Framework to ${{env.OAF_VERSION}}'"
- name: Push Changes
run: git push -f --set-upstream origin update/open-api-framework-${{env.OAF_VERSION}}
- name: Check for Existing PR
id: existing-pr
run: gh pr view update/open-api-framework-${{env.OAF_VERSION}} >> /dev/null
- name: Create PR
if: success()
run: |
gh pr create --title "Update Open API Framework to ${{env.OAF_VERSION}}"\
--body "Auto generated with github action ${{github.run_id}}"
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}