forked from astarte-platform/stream-rust-test
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (38 loc) · 1.02 KB
/
dco.yaml
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
# This file is part of Astarte.
#
# Copyright 2024 SECO Mind Srl
#
# SPDX-License-Identifier: Apache-2.0
name: dco
on:
workflow_dispatch:
inputs:
pr:
type: string
workflow_call:
inputs:
pr:
type: string
permissions:
actions: read
pull-requests: read
env:
GH_TOKEN: ${{ github.token }}
jobs:
check:
runs-on: ubuntu-latest
steps:
- run: echo 'Checking DCO status for PR \#'${{ inputs.pr }}''
- name: check DCO passed
# Check the DCO only for PRs
if: inputs.pr != ''
shell: bash
# Use the gh to view the status checks on the PR, find the one named DCO and check that the
# conclusion is "SUCCESS" and not something like "ACTION_REQUIRED"
run: |
DCO="$(gh pr view '${{ inputs.pr }}' --json statusCheckRollup \
--jq '.statusCheckRollup.[] | select ( .name == "DCO" ) | .conclusion ' \
--repo ${{ github.repository }}
)"
echo "DCO status is '$DCO'"
test "$DCO" == "SUCCESS"