Skip to content

Sort envs returned by REST API by current build's scheduled_on time #48

Sort envs returned by REST API by current build's scheduled_on time

Sort envs returned by REST API by current build's scheduled_on time #48

name: "Generate openapi.json"
env:
DEFAULT_PYTHON_VERSION: "3.12"
on:
pull_request:
paths: ['conda-store-server/conda_store_server/**']
jobs:
update-openapi-json:
runs-on: ubuntu-latest
# so that we can skip this job by adding 'skip openapi' to the commit message
# and only run it when the PR is against the main branch of our repo
if: "!contains(github.event.head_commit.message, '[openapi skip]') && github.repository=='conda-incubator/conda-store'"
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
defaults:
run:
shell: bash -el {0}
steps:
- name: "Install jq 📦"
run: |
sudo apt update
sudo apt install -y jq

Check failure on line 28 in .github/workflows/generate_api_docs.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/generate_api_docs.yaml

Invalid workflow file

You have an error in your yaml syntax on line 28
- name: "Checkout repository 🛎️"
uses: actions/checkout@v4
# Must set the ref so that this works in github actions; see
# https://github.com/stefanzweifel/git-auto-commit-action/tree/master?tab=readme-ov-file#example-workflow
ref: ${{ github.head_ref }}
- name: "Set up Miniconda 🐍"
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: conda-store-server/environment-dev.yaml
- name: "Install conda-store-server 📦"
run: python -m pip install conda-store-server/.
- name: "Run openapi.json generation script"
run: |
python docusaurus-docs/scripts/generate_openapi_json.py
jq . --sort-keys docusaurus-docs/static/openapi.json > docusaurus-docs/static/openapi.json.formatted
mv docusaurus-docs/static/openapi.json.formatted docusaurus-docs/static/openapi.json
- name: "Commit changes"
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'Update REST API documentation (openapi.json)'
file_pattern: 'docusaurus-docs/static/openapi.json'