mirror of
https://github.com/LukeHagar/api-specs.git
synced 2025-12-09 12:27:48 +00:00
added action to dereference spec
This commit is contained in:
34
.github/workflows/build-dereferenced-v3-spec.yml
vendored
Normal file
34
.github/workflows/build-dereferenced-v3-spec.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
name: "Push API Specs to Developer Portal"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- idn/sailpoint-api.v3.yaml
|
||||
- idn/v3/**
|
||||
|
||||
jobs:
|
||||
dereference_spec:
|
||||
name: Push API spec changes
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# Checkout the master branch request to run rsync
|
||||
- name: Checkout PR branch
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
# Node is required for npm
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v3
|
||||
|
||||
- name: Install swagger-cli
|
||||
run: |
|
||||
npm install -g @apidevtools/swagger-cli
|
||||
|
||||
- name: Dereference API Specification
|
||||
run: |
|
||||
swagger-cli bundle --dereference idn/sailpoint-api.v3.yaml -t yaml -o dereferenced/idn-v3-spec.yaml
|
||||
|
||||
- uses: stefanzweifel/git-auto-commit-action@v4
|
||||
54
.github/workflows/build-spec.yml
vendored
54
.github/workflows/build-spec.yml
vendored
@@ -1,54 +0,0 @@
|
||||
name: "Push API Specs to Developer Portal"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
push_spec_workflow:
|
||||
name: Push API spec changes
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# Checkout the master branch request to run rsync
|
||||
- name: Checkout PR branch
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
# Checkout the main branch of api-specs
|
||||
- name: Checkout API Specs Repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: sailpoint-oss/developer.sailpoint.com
|
||||
path: developer-community
|
||||
ref: main
|
||||
|
||||
- name: Install rsync
|
||||
run: |
|
||||
sudo apt install rsync grsync
|
||||
|
||||
- name: Sync files between folders
|
||||
run: |
|
||||
CURRENT_SPEC_PATH="idn/"
|
||||
NEW_API_SPEC_PATH="developer-community/static/api-specs/idn/"
|
||||
|
||||
rsync -cav --delete $CURRENT_SPEC_PATH $NEW_API_SPEC_PATH
|
||||
|
||||
cd developer-community
|
||||
git status
|
||||
|
||||
git config --unset-all http.https://github.com/.extraheader
|
||||
git config --local user.email "tyler.mairose@sailpoint.com"
|
||||
git config --local user.name "GitHub Action Bot"
|
||||
|
||||
git add .
|
||||
git commit -m "Automated commit by github action: ${{ github.run_id }}"
|
||||
|
||||
git status
|
||||
|
||||
git remote set-url origin https://${{secrets.API_SPEC_PAT}}@github.com/sailpoint-oss/developer.sailpoint.com.git
|
||||
|
||||
git remote -v
|
||||
|
||||
git push
|
||||
Reference in New Issue
Block a user