-
Notifications
You must be signed in to change notification settings - Fork 223
42 lines (39 loc) · 1.34 KB
/
dashboard-done.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Copyright 2023 Thales Silicon Security
#
# Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0
# You may obtain a copy of the License at https://solderpad.org/licenses/
#
# Original Author: Côme ALLART - Thales
on:
workflow_dispatch:
inputs:
pr_number:
description: 'ID of the PR to comment'
required: true
type: string
success:
description: 'Is the workflow successful?'
required: true
type: boolean
permissions:
pull-requests: write
jobs:
welcome:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
script: |
const inputs = context.payload.inputs
const pr = inputs.pr_number
const success = inputs.success == 'true'
const status_text = success ? ":heavy_check_mark: successful" : ":x: failed"
const url = `https://riscv-ci.pages.thales-invia.fr/dashboard/dashboard_core-v-verif_${pr}.html`
await github.rest.issues.createComment({
issue_number: pr,
owner: context.repo.owner,
repo: context.repo.repo,
body: `${status_text} run, report available [here](${url}).`
})