Automated build 'Automated commit 'Merge pull request #2176 from sail… #133
This file contains hidden or 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: "Push PowerShell SDK Docs to Developer Portal" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| push_spec_workflow: | |
| name: Push API spec changes | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout PR branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.ref }} | |
| path: powershell-sdk | |
| - name: Checkout API Specs Repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: sailpoint-oss/developer.sailpoint.com | |
| path: developer-community | |
| ref: main | |
| token: ${{ secrets.DEVREL_SERVICE_TOKEN }} | |
| fetch-depth: 0 | |
| - name: Sync local to remote main | |
| working-directory: developer-community | |
| run: | | |
| git fetch origin main | |
| git reset --hard origin/main | |
| - name: Install rsync | |
| run: sudo apt update && sudo apt install -y rsync grsync | |
| - name: Sync files between folders | |
| run: | | |
| # v3 | |
| rsync -cav --delete powershell-sdk/PSSailpoint/v3/docs/Methods developer-community/docs/tools/sdk/powershell/Reference/V3 | |
| rsync -cav --delete powershell-sdk/PSSailpoint/v3/docs/Models developer-community/docs/tools/sdk/powershell/Reference/V3 | |
| rsync -av powershell-sdk/PSSailpoint/v3/docs/Examples/powershell_code_examples_overlay.yaml developer-community/static/code-examples/v3/ | |
| # beta | |
| rsync -cav --delete powershell-sdk/PSSailpoint/beta/docs/Methods developer-community/docs/tools/sdk/powershell/Reference/Beta | |
| rsync -cav --delete powershell-sdk/PSSailpoint/beta/docs/Models developer-community/docs/tools/sdk/powershell/Reference/Beta | |
| rsync -av powershell-sdk/PSSailpoint/beta/docs/Examples/powershell_code_examples_overlay.yaml developer-community/static/code-examples/beta/ | |
| # v2024 | |
| rsync -cav --delete powershell-sdk/PSSailpoint/v2024/docs/Methods developer-community/docs/tools/sdk/powershell/Reference/V2024 | |
| rsync -cav --delete powershell-sdk/PSSailpoint/v2024/docs/Models developer-community/docs/tools/sdk/powershell/Reference/V2024 | |
| rsync -av powershell-sdk/PSSailpoint/v2024/docs/Examples/powershell_code_examples_overlay.yaml developer-community/static/code-examples/v2024/ | |
| # v2025 | |
| rsync -cav --delete powershell-sdk/PSSailpoint/v2025/docs/Methods developer-community/docs/tools/sdk/powershell/Reference/V2025 | |
| rsync -cav --delete powershell-sdk/PSSailpoint/v2025/docs/Models developer-community/docs/tools/sdk/powershell/Reference/V2025 | |
| rsync -av powershell-sdk/PSSailpoint/v2025/docs/Examples/powershell_code_examples_overlay.yaml developer-community/static/code-examples/v2025/ | |
| - name: Check for changes and commit if any | |
| working-directory: developer-community | |
| run: | | |
| if git diff --quiet; then | |
| echo "No changes to commit." | |
| exit 0 | |
| fi | |
| 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 PowerShell 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 origin main | |
| 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 }}" |