Skip to content

Commit

Permalink
SONARPY-1978 Change CI Releasability checks to always be green allowi…
Browse files Browse the repository at this point in the history
…ng us to see the status by looking at the text (SonarSource#1851)
  • Loading branch information
ghislainpiot authored Jul 16, 2024
1 parent 0370a28 commit 7698896
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions .github/workflows/releasability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,36 @@ jobs:
github.event.check_suite.conclusion == 'success' &&
github.event.check_suite.app.slug == 'cirrus-ci')
steps:
- uses: >-
SonarSource/gh-action_releasability/[email protected]
- uses: SonarSource/gh-action_releasability/[email protected]
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
continue-on-error: true

- name: Check current status
id: check_status
uses: octokit/[email protected]
with:
route: GET /repos/${{ github.repository }}/commits/${{ github.sha }}/status
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Extract status information
id: extract_info
run: |
status_info=$(echo '${{ steps.check_status.outputs.data }}' | jq -r '.statuses[] | select(.context == "Releasability") | {description: .description, target_url: .target_url}')
description=$(echo "$status_info" | jq -r '.description')
target_url=$(echo "$status_info" | jq -r '.target_url')
echo "::set-output name=description::$description"
echo "::set-output name=target_url::$target_url"
- name: Update status to success
if: fromJson(steps.check_status.outputs.data).state != 'success'
uses: octokit/[email protected]
with:
route: POST /repos/${{ github.repository }}/statuses/${{ github.sha }}
state: "success"
target_url: "${{ steps.extract_info.outputs.target_url }}"
description: "${{ steps.extract_info.outputs.description }} (status rewritten)"
context: "Releasability"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 7698896

Please sign in to comment.