Skip to content

Automated commit 'ISCNAPS-4827remove patch endpoint from approvals ap… #453

Automated commit 'ISCNAPS-4827remove patch endpoint from approvals ap…

Automated commit 'ISCNAPS-4827remove patch endpoint from approvals ap… #453

name: "Build and push powershell sdk"
on:
push:
branches:
- main
paths:
- idn/**
workflow_dispatch:
jobs:
push_powershell_sdk_workflow:
name: Build and push Powershell SDK
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/powershell-sdk
path: powershell-sdk
ref: main
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: "16"
- name: Run Prescript
id: prescript
run: |
cd powershell-sdk
node sdk-resources/prescript.js ../idn/
- name: Build V3 SDK
id: buildV3
run: |
cd powershell-sdk
rm -rf ./PSSailpoint/v3
java -jar openapi-generator-cli.jar generate -i ../idn/sailpoint-api.v3.yaml -g powershell -o PSSailpoint/v3 --global-property skipFormModel=false --config sdk-resources/v3-config.yaml
node sdk-resources/postscript.js ./PSSailpoint/v3
- name: Build Beta SDK
id: buildBeta
if: steps.buildV3.outcome == 'success'
run: |
cd powershell-sdk
rm -rf ./PSSailpoint/beta
java -jar openapi-generator-cli.jar generate -i ../idn/sailpoint-api.beta.yaml -g powershell -o PSSailpoint/beta --global-property skipFormModel=false --config sdk-resources/beta-config.yaml
node sdk-resources/postscript.js ./PSSailpoint/beta
- name: Build V2024 SDK
id: buildV2024
if: steps.buildV3.outcome == 'success'
run: |
cd powershell-sdk
rm -rf ./PSSailpoint/v2024
java -jar openapi-generator-cli.jar generate -i ../idn/sailpoint-api.v2024.yaml -g powershell -o PSSailpoint/v2024 --global-property skipFormModel=false --config sdk-resources/v2024-config.yaml
node sdk-resources/postscript.js ./PSSailpoint/v2024
- name: After SDK Generation
id: buildSDK
if: steps.buildV2024.outcome == 'success'
shell: pwsh
run: |
cd powershell-sdk
$DebugPreference="Continue"
./PSSailpoint/Build.ps1
./PSSailpoint/v3/Build.ps1
./PSSailpoint/v2024/Build.ps1
./PSSailpoint/beta/Build.ps1
Import-Module -Name '.\PSSailpoint\beta\src\PSSailpoint.Beta' -Verbose
Import-Module -Name '.\PSSailpoint\v3\src\PSSailpoint.V3' -Verbose
Import-Module -Name '.\PSSailpoint\v2024\src\PSSailpoint.V2024' -Verbose
. .\PSSailpoint\Configuration.ps1
. .\PSSailpoint\Pagination.ps1
- name: After SDK Build
if: steps.buildSDK.outcome == 'success'
run: |
cd powershell-sdk
git config --unset-all http.https://github.com/.extraheader
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action Bot"
if git status --porcelain | grep -q .; then
# Changes are present
git add .
git commit -m "Automated build '${{ github.event.head_commit.message }}' powershell sdk: ${{ github.run_id }}"
git remote set-url origin https://${{secrets.DEVREL_SERVICE_TOKEN}}@github.com/sailpoint-oss/powershell-sdk.git
git remote -v
git push
else
# No changes are present
echo "No changes to commit"
fi
push_powershell_sdk_workflow-failure:
runs-on: ubuntu-latest
if: ${{ always() && (needs.push_powershell_sdk_workflow.result == 'failure' || needs.push_powershell_sdk_workflow.result == 'timed_out') }}
needs:
- push_powershell_sdk_workflow
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 }}"