From 6b7d8f4eb9f865148fec1a6348dc3136fd17e1cd Mon Sep 17 00:00:00 2001 From: darrell-thobe-sp Date: Wed, 14 May 2025 15:51:16 -0400 Subject: [PATCH] update checkout version --- .../push_sdk_docs_to_dev_portal.yaml | 99 ++++++++----------- 1 file changed, 43 insertions(+), 56 deletions(-) diff --git a/.github/workflows/push_sdk_docs_to_dev_portal.yaml b/.github/workflows/push_sdk_docs_to_dev_portal.yaml index 6124de096..6d7ca11a7 100644 --- a/.github/workflows/push_sdk_docs_to_dev_portal.yaml +++ b/.github/workflows/push_sdk_docs_to_dev_portal.yaml @@ -11,84 +11,71 @@ jobs: 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 + uses: actions/checkout@v4 with: ref: ${{ github.ref }} path: python-sdk - # Checkout the main branch of the developer portal to push changes - name: Checkout API Specs Repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: sailpoint-oss/developer.sailpoint.com path: developer-community ref: main - name: Install rsync - run: | - sudo apt install rsync grsync + run: sudo apt update && sudo apt install -y rsync grsync - name: Sync files between folders run: | - CURRENT_V3_CODE_EXAMPLES_PATH="python-sdk/sailpoint/v3/docs/Examples/python_code_examples_overlay.yaml" - NEW_V3_CODE_EXAMPLES_PATH="developer-community/static/code-examples/v3/" - CURRENT_V3_SPEC_PATH_METHODS="python-sdk/sailpoint/v3/docs/Methods" - NEW_V3_API_SPEC_PATH_METHODS="developer-community/docs/tools/sdk/python/Reference/V3" - CURRENT_V3_SPEC_PATH_MODELS="python-sdk/sailpoint/v3/docs/Models" - NEW_V3_API_SPEC_PATH_MODELS="developer-community/docs/tools/sdk/python/Reference/V3" - - CURRENT_BETA_CODE_EXAMPLES_PATH="python-sdk/sailpoint/beta/docs/Examples/python_code_examples_overlay.yaml" - NEW_BETA_CODE_EXAMPLES_PATH="developer-community/static/code-examples/beta/" - CURRENT_BETA_SPEC_PATH_METHODS="python-sdk/sailpoint/beta/docs/Methods" - NEW_BETA_API_SPEC_PATH_METHODS="developer-community/docs/tools/sdk/python/Reference/Beta" - CURRENT_BETA_SPEC_PATH_MODELS="python-sdk/sailpoint/beta/docs/Models" - NEW_BETA_API_SPEC_PATH_MODELS="developer-community/docs/tools/sdk/python/Reference/Beta" + # v3 + rsync -cav --delete python-sdk/sailpoint/v3/docs/Methods developer-community/docs/tools/sdk/python/Reference/V3 + rsync -cav --delete python-sdk/sailpoint/v3/docs/Models developer-community/docs/tools/sdk/python/Reference/V3 + rsync -av python-sdk/sailpoint/v3/docs/Examples/python_code_examples_overlay.yaml developer-community/static/code-examples/v3/ - CURRENT_V2024_CODE_EXAMPLES_PATH="python-sdk/sailpoint/v2024/docs/Examples/python_code_examples_overlay.yaml" - NEW_V2024_CODE_EXAMPLES_PATH="developer-community/static/code-examples/v2024/" - CURRENT_V2024_SPEC_PATH_METHODS="python-sdk/sailpoint/v2024/docs/Methods" - NEW_V2024_API_SPEC_PATH_METHODS="developer-community/docs/tools/sdk/python/Reference/V2024" - CURRENT_V2024_SPEC_PATH_MODELS="python-sdk/sailpoint/v2024/docs/Models" - NEW_V2024_API_SPEC_PATH_MODELS="developer-community/docs/tools/sdk/python/Reference/V2024" + # beta + rsync -cav --delete python-sdk/sailpoint/beta/docs/Methods developer-community/docs/tools/sdk/python/Reference/Beta + rsync -cav --delete python-sdk/sailpoint/beta/docs/Models developer-community/docs/tools/sdk/python/Reference/Beta + rsync -av python-sdk/sailpoint/beta/docs/Examples/python_code_examples_overlay.yaml developer-community/static/code-examples/beta/ - CURRENT_V2025_CODE_EXAMPLES_PATH="python-sdk/sailpoint/v2025/docs/Examples/python_code_examples_overlay.yaml" - NEW_V2025_CODE_EXAMPLES_PATH="developer-community/static/code-examples/v2025/" - CURRENT_V2025_SPEC_PATH_METHODS="python-sdk/sailpoint/v2025/docs/Methods" - NEW_V2025_API_SPEC_PATH_METHODS="developer-community/docs/tools/sdk/python/Reference/V2025" - CURRENT_V2025_SPEC_PATH_MODELS="python-sdk/sailpoint/v2025/docs/Models" - NEW_V2025_API_SPEC_PATH_MODELS="developer-community/docs/tools/sdk/python/Reference/V2025" + # v2024 + rsync -cav --delete python-sdk/sailpoint/v2024/docs/Methods developer-community/docs/tools/sdk/python/Reference/V2024 + rsync -cav --delete python-sdk/sailpoint/v2024/docs/Models developer-community/docs/tools/sdk/python/Reference/V2024 + rsync -av python-sdk/sailpoint/v2024/docs/Examples/python_code_examples_overlay.yaml developer-community/static/code-examples/v2024/ - rsync -cav --delete $CURRENT_V3_SPEC_PATH_METHODS $NEW_V3_API_SPEC_PATH_METHODS - rsync -cav --delete $CURRENT_BETA_SPEC_PATH_METHODS $NEW_BETA_API_SPEC_PATH_METHODS - rsync -cav --delete $CURRENT_V2024_SPEC_PATH_METHODS $NEW_V2024_API_SPEC_PATH_METHODS - rsync -cav --delete $CURRENT_V2025_SPEC_PATH_METHODS $NEW_V2025_API_SPEC_PATH_METHODS - rsync -cav --delete $CURRENT_V3_SPEC_PATH_MODELS $NEW_V3_API_SPEC_PATH_MODELS - rsync -cav --delete $CURRENT_BETA_SPEC_PATH_MODELS $NEW_BETA_API_SPEC_PATH_MODELS - rsync -cav --delete $CURRENT_V2024_SPEC_PATH_MODELS $NEW_V2024_API_SPEC_PATH_MODELS - rsync -cav --delete $CURRENT_V2025_SPEC_PATH_MODELS $NEW_V2025_API_SPEC_PATH_MODELS - - rsync -av $CURRENT_V3_CODE_EXAMPLES_PATH $NEW_V3_CODE_EXAMPLES_PATH - rsync -av $CURRENT_BETA_CODE_EXAMPLES_PATH $NEW_BETA_CODE_EXAMPLES_PATH - rsync -av $CURRENT_V2024_CODE_EXAMPLES_PATH $NEW_V2024_CODE_EXAMPLES_PATH - rsync -av $CURRENT_V2025_CODE_EXAMPLES_PATH $NEW_V2025_CODE_EXAMPLES_PATH + # v2025 + rsync -cav --delete python-sdk/sailpoint/v2025/docs/Methods developer-community/docs/tools/sdk/python/Reference/V2025 + rsync -cav --delete python-sdk/sailpoint/v2025/docs/Models developer-community/docs/tools/sdk/python/Reference/V2025 + rsync -av python-sdk/sailpoint/v2025/docs/Examples/python_code_examples_overlay.yaml developer-community/static/code-examples/v2025/ - name: Check for changes and commit if any run: | cd developer-community - git status - if git diff --exit-code; then + if git diff --quiet; then echo "No changes to commit." exit 0 - else - git config --unset-all http.https://github.com/.extraheader - git config --local user.email "devrel-service@sailpoint.com" - git config --local user.name "developer-relations-sp" - git add . - git commit -m "Update to python SDK docs: ${{ github.run_id }}" - git status - git remote set-url origin https://${{secrets.DEVREL_SERVICE_TOKEN}}@github.com/sailpoint-oss/developer.sailpoint.com.git - git remote -v - git push fi + git config --local user.email "devrel-service@sailpoint.com" + git config --local user.name "developer-relations-sp" + git add . + git commit -m "Update python SDK docs: ${{ github.run_id }}" + git remote set-url origin https://${{ secrets.DEVREL_SERVICE_TOKEN }}@github.com/sailpoint-oss/developer.sailpoint.com.git + git push + + publish-failure: + name: Notify on failure + runs-on: ubuntu-latest + needs: push_spec_workflow + if: ${{ always() && (needs.push_spec_workflow.result == 'failure' || needs.push_spec_workflow.result == 'timed_out') }} + steps: + - name: Invoke GithubNotificationsFunction Lambda + run: | + curl -X POST \ + -H "Content-Type: application/json" \ + -d '{ + "workflowName": "${{ github.job }}", + "repositoryName": "${{ github.event.repository.name }}", + "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + }' \ + "${{ secrets.NOTIFICATIONS_FUNCTION_URL }}"