Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/actions/fork-result-label/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Add label to PR with CI results
description: Add label to PR with CI results
inputs:
SUCCESS:
description: Boolean to know if add a success label or a failure label.
required: true
TOKEN:
description: Github token
required: true
PULL_REQUEST_NUMBER:
description: Pull request id
required: false
default: "0"
runs:
using: "composite"
steps:
- name: delete success label
uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0
with:
labels: "CI Passed"
number: ${{ inputs.PULL_REQUEST_NUMBER }}
- name: delete fail label
uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0
with:
labels: "CI Failed"
number: ${{ inputs.PULL_REQUEST_NUMBER }}
- name: adding success label
uses: actions-ecosystem/action-add-labels@bd52874380e3909a1ac983768df6976535ece7f8
if: ${{ inputs.SUCCESS == 'true' }}
with:
labels: "CI Passed"
number: ${{ inputs.PULL_REQUEST_NUMBER }}
github_token: ${{ inputs.TOKEN }}
- name: adding fail label
uses: actions-ecosystem/action-add-labels@bd52874380e3909a1ac983768df6976535ece7f8
if: ${{ inputs.SUCCESS == 'false' }}
with:
labels: "CI Failed"
number: ${{ inputs.PULL_REQUEST_NUMBER }}
github_token: ${{ inputs.TOKEN }}
16 changes: 16 additions & 0 deletions .github/workflows/test-deploy-fork.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,14 @@ jobs:
❌ CI run has failed!
Please see logs at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'

- name: Label
uses: ./.github/actions/fork-result-label
continue-on-error: true
with:
SUCCESS: 'false'
PULL_REQUEST_NUMBER: ${{ env.PR_NUMBER }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}

notify_success:
runs-on: ubuntu-latest
if: success()
Expand All @@ -294,3 +302,11 @@ jobs:
COMMENT_BODY: |
✅ CI run has succeded!
You can find tests and deployment logs at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'

- name: Label
uses: ./.github/actions/fork-result-label
continue-on-error: true
with:
SUCCESS: 'true'
PULL_REQUEST_NUMBER: ${{ env.PR_NUMBER }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}