1- name : Test example positive
1+ name : Test Positive
22on :
3- # # Uncomment when test added first time to register workflow and comment it back after workflow would be registered
4- # #
5- # # Added pull_request to register workflow from the PR.
6- # # Read more https://stackoverflow.com/questions/63362126/github-actions-how-to-run-a-workflow-created-on-a-non-master-branch-from-the-wo
7- # pull_request: {}
3+ # # Uncomment when test added first time to register workflow and comment it back after workflow would be registered
4+ # #
5+ # # Added pull_request to register workflow from the PR.
6+ # # Read more https://stackoverflow.com/questions/63362126/github-actions-how-to-run-a-workflow-created-on-a-non-master-branch-from-the-wo
7+ # pull_request: {}
88 workflow_dispatch : {}
99
1010jobs :
1414 - name : Setup
1515 run : echo "Do setup"
1616
17+ - id : random
18+ shell : bash
19+ run : |-
20+ echo "password=$(echo $RANDOM | md5sum | head -c 20)" >> $GITHUB_OUTPUT
21+ echo "environment=$(echo $RANDOM | md5sum | head -c 20)" >> $GITHUB_OUTPUT
22+
23+ outputs :
24+ random : ${{ steps.random.outputs.password }}
25+ environment : ${{ steps.random.outputs.environment }}
26+
27+
28+ set_status :
29+ runs-on : ubuntu-latest
30+ needs : [setup]
31+ steps :
32+ - name : Sleep for 10s
33+ uses : juliangruber/sleep-action@v2.0.0
34+ with :
35+ time : 30s
36+
37+ - name : Set status
38+ uses : myrotvorets/set-commit-status-action@master
39+ with :
40+ repo : ${{ github.repository }}
41+ sha : ${{ github.sha }}
42+ token : ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
43+ status : success
44+ context : continuous-delivery/${{ needs.setup.outputs.environment }}.test-app
45+
1746 test :
1847 runs-on : ubuntu-latest
1948 continue-on-error : true
@@ -25,19 +54,23 @@ jobs:
2554 - uses : ./
2655 id : current
2756 with :
28- param1 : ' true'
57+ repository : ${{ github.repository }}
58+ sha : ${{ github.sha }}
59+ status : continuous-delivery/${{ needs.setup.outputs.environment }}.test-app
60+ expected_state : " success"
61+ token : ${{ github.token }}
2962
3063 outputs :
31- result : " ${{ steps.current.outputs.result1 }}"
64+ status : ${{ steps.current.outcome }}
3265
3366 assert :
3467 runs-on : ubuntu-latest
35- needs : [test]
68+ needs : [test, set_status ]
3669 steps :
3770 - uses : nick-fields/assert-action@v1
3871 with :
39- expected : ' true '
40- actual : " ${{ needs.test.outputs.result }}"
72+ expected : " success "
73+ actual : " ${{ needs.test.outputs.status }}"
4174
4275 teardown :
4376 runs-on : ubuntu-latest
0 commit comments