-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathpush_sdk_docs_to_dev_portal.yaml
More file actions
92 lines (79 loc) · 4.06 KB
/
Copy pathpush_sdk_docs_to_dev_portal.yaml
File metadata and controls
92 lines (79 loc) · 4.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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 }}"