@@ -7,51 +7,24 @@ name: Releasability status
77
88jobs :
99 update_releasability_status :
10- runs-on : ubuntu-latest
11- name : Releasability status
12- permissions :
13- id-token : write
14- statuses : write
15- contents : read
16- if : >-
17- github.event_name == 'workflow_dispatch' ||
18- ((contains(fromJSON('["main", "master"]'),
19- github.event.check_suite.head_branch) ||
20- startsWith(github.event.check_suite.head_branch, 'dogfood-') ||
21- startsWith(github.event.check_suite.head_branch, 'branch-')) &&
22- github.event.check_suite.conclusion == 'success' &&
23- github.event.check_suite.app.slug == 'cirrus-ci')
24- steps :
25- -
uses :
SonarSource/gh-action_releasability/[email protected] 26- env :
27- GITHUB_TOKEN : ' ${{ secrets.GITHUB_TOKEN }}'
28- continue-on-error : true
29-
30- - name : Check current status
31- id : check_status
32- 33- with :
34- route : GET /repos/${{ github.repository }}/commits/${{ github.sha }}/status
35- env :
36- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
37-
38- - name : Extract status information
39- id : extract_info
40- run : |
41- status_info=$(echo '${{ steps.check_status.outputs.data }}' | jq -r '.statuses[] | select(.context == "Releasability") | {description: .description, target_url: .target_url}')
42- description=$(echo "$status_info" | jq -r '.description')
43- target_url=$(echo "$status_info" | jq -r '.target_url')
44- echo "::set-output name=description::$description"
45- echo "::set-output name=target_url::$target_url"
46-
47- - name : Update status to success
48- if : fromJson(steps.check_status.outputs.data).state != 'success'
49- 50- with :
51- route : POST /repos/${{ github.repository }}/statuses/${{ github.sha }}
52- state : " success"
53- target_url : " ${{ steps.extract_info.outputs.target_url }}"
54- description : " ${{ steps.extract_info.outputs.description }} (status rewritten)"
55- context : " Releasability"
56- env :
57- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
10+ runs-on : ubuntu-latest
11+ name : Releasability status
12+ permissions :
13+ id-token : write
14+ statuses : write
15+ contents : read
16+ if : >-
17+ github.event_name == 'workflow_dispatch' ||
18+ ((contains(fromJSON('["main", "master"]'),
19+ github.event.check_suite.head_branch) ||
20+ startsWith(github.event.check_suite.head_branch, 'dogfood-') ||
21+ startsWith(github.event.check_suite.head_branch, 'branch-')) &&
22+ github.event.check_suite.conclusion == 'success' &&
23+ github.event.check_suite.app.slug == 'cirrus-ci')
24+ steps :
25+ - uses : >-
26+ SonarSource/gh-action_releasability/releasability-status@v2
27+ with:
28+ optional_checks: "Jira"
29+ env:
30+ GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
0 commit comments