cloud_check测试 #24
This file contains 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: Auto Review PR | |
on: | |
push: | |
jobs: | |
deployment: | |
runs-on: ubuntu-latest | |
steps: | |
- name: getToken | |
id: getToken | |
uses: fjogeleit/http-request-action@v1 | |
with: | |
url: 'https://tcloudrunconsole.openapi.cloudrun.cloudbaseapp.cn/v2/login/serviceaccount' | |
method: 'POST' | |
customHeaders: '{"Content-Type": "application/json"}' | |
data: '{ "parent_uid":"14955076510547972", "private_key": "PpaeApOVW+ygrCC5pKYJaOXFY1kQpG7kdr7KYS5VshgPJNlcKL7YU6KuEASY2PGIEG131TT2FUutRmnfPOMJLPbx06xReel8zIDMnLqQwuSh9d2f3yydS15bFkzpUaANKzOAivY7dTBeTZTkpkmveYqSLaPXHqgegXzYDOrRCSw=" }' | |
# | |
# - name: triggerFlow | |
# id: triggerFlow | |
# uses: fjogeleit/http-request-action@v1 #任务 | |
# with: | |
# url: 'https://tdevstudio.openapi.cloudrun.cloudbaseapp.cn/webapi/v1/space/600087/project/5000012/pipeline/execute' | |
# method: 'POST' | |
# bearerToken: '${{fromJson(steps.getToken.outputs.response).data.access_token}}' | |
# customHeaders: '{"Content-Type": "application/json","x-node-id":"14955076510547972"}' | |
# data: '{"templateId":795,"branch":"master"}' | |
# | |
# - name: Show Response #step按序执行,可获取上一步的返回结果 | |
# run: | | |
# echo ${{ steps.triggerFlow.outputs.response }} | |
# echo ${{ steps.triggerFlow.outputs.headers }} | |
# echo ${{fromJson(steps.triggerFlow.outputs.response).result.recordId}} | |
# - name: waitingForExecution | |
# run: sleep 120 | |
- name: getRecordInfo | |
id: getRecordInfo | |
uses: fjogeleit/http-request-action@v1 #任务 | |
with: | |
url: 'https://tdevstudio.openapi.cloudrun.cloudbaseapp.cn/webapi/v1/space/600087/project/5000012/pipeline/3756' | |
method: 'GET' | |
bearerToken: '${{fromJson(steps.getToken.outputs.response).data.access_token}}' | |
customHeaders: '{"Content-Type": "application/json","x-node-id":"14955076510547972"}' | |
- name: getJobInfo | |
id: getJobInfo | |
if: ${{ success() && fromJson(steps.getRecordInfo.outputs.response).result.result != 'SUCCESS' }} | |
uses: fjogeleit/http-request-action@v1 #任务 | |
with: | |
url: 'https://tdevstudio.openapi.cloudrun.cloudbaseapp.cn/webapi/v1/space/600087/project/5000012/pipeline/3654/job/6053' | |
method: 'GET' | |
bearerToken: '${{fromJson(steps.getToken.outputs.response).data.access_token}}' | |
customHeaders: '{"Content-Type": "application/json","x-node-id":"14955076510547972"}' | |
- name: showError | |
if: ${{ success() && fromJson(steps.getRecordInfo.outputs.response).result.result != 'SUCCESS' }} | |
run: | | |
echo ${{fromJson(steps.getJobInfo.outputs.response).result.data.urgent}} | |
exit 1 | |
- name: showError | |
if: ${{ success() && fromJson(steps.getRecordInfo.outputs.response).result.result == 'SUCCESS' }} | |
run: | | |
echo 'Scan complete! ALl good!' |