forked from SonarSource/sonar-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SONARPY-1978 Change CI Releasability checks to always be green allowi…
…ng us to see the status by looking at the text (SonarSource#1851)
- Loading branch information
1 parent
0370a28
commit 7698896
Showing
1 changed file
with
30 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 }} |