@@ -22,49 +22,33 @@ jobs:
22
22
check-prdoc :
23
23
runs-on : ubuntu-latest
24
24
timeout-minutes : 10
25
- if : github.event.pull_request.number != ''
26
25
steps :
27
26
- name : Checkout repo
28
27
uses : actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.1.7
29
- # we cannot show the version in this step (ie before checking out the repo)
30
- # due to https://github.com/paritytech/prdoc/issues/15
31
- - name : Check if PRdoc is required
32
- id : get-labels
28
+ - name : Check prdoc format
33
29
run : |
34
30
echo "Pulling $IMAGE"
35
31
$ENGINE pull $IMAGE
36
32
37
- # Fetch the labels for the PR under test
38
- echo "Fetch the labels for $API_BASE/${REPO}/pulls/${GITHUB_PR}"
39
- labels=$( curl -H "Authorization: token ${GITHUB_TOKEN}" -s "$API_BASE/${REPO}/pulls/${GITHUB_PR}" | jq '.labels | .[] | .name' | tr "\n" ",")
40
- echo "Labels: ${labels}"
41
- echo "labels=${labels}" >> "$GITHUB_OUTPUT"
42
-
43
33
echo "Checking PRdoc version"
44
34
$ENGINE run --rm -v $PWD:/repo $IMAGE --version
45
35
46
- - name : Early exit if PR is silent
47
- if : ${{ contains(steps.get-labels.outputs.labels, 'R0') }}
48
- run : |
49
- hits=$(find prdoc -name "pr_$GITHUB_PR*.prdoc" | wc -l)
50
- if (( hits > 0 )); then
51
- echo "PR detected as silent, but a PRDoc was found, checking it as information"
52
- $ENGINE run --rm -v $PWD:/repo $IMAGE check -n ${GITHUB_PR} || echo "Ignoring failure"
53
- else
54
- echo "PR detected as silent, no PRDoc found, exiting..."
55
- fi
56
- echo "If you want to add a PRDoc, please refer to $PRDOC_DOC"
57
- exit 0
36
+ echo "Check prdoc format"
37
+ echo "For PRDoc format, please refer to $PRDOC_DOC"
38
+ $ENGINE run --rm -v $PWD:/repo -e RUST_LOG=info $IMAGE check
58
39
59
- - name : PRdoc check for PR#${{ github.event.pull_request.number }}
60
- if : ${{ !contains(steps.get-labels.outputs.labels, 'R0') }}
40
+ - name : Check if PRdoc is required
41
+ if : github.event.pull_request.number != ''
42
+ id : get-labels
61
43
run : |
62
- echo "Checking for PR#${GITHUB_PR}"
63
- echo "You can find more information about PRDoc at $PRDOC_DOC"
64
- $ENGINE run --rm -v $PWD:/repo -e RUST_LOG=info $IMAGE check -n ${GITHUB_PR}
44
+ # Fetch the labels for the PR under test
45
+ echo "Fetch the labels for $API_BASE/${REPO}/pulls/${GITHUB_PR}"
46
+ labels=$( curl -H "Authorization: token ${GITHUB_TOKEN}" -s "$API_BASE/${REPO}/pulls/${GITHUB_PR}" | jq '.labels | .[] | .name' | tr "\n" ",")
47
+ echo "Labels: ${labels}"
48
+ echo "labels=${labels}" >> "$GITHUB_OUTPUT"
65
49
66
50
- name : Validate prdoc for PR#${{ github.event.pull_request.number }}
67
- if : ${{ !contains(steps.get-labels.outputs.labels, 'R0') }}
51
+ if : ${{ github.event.pull_request.number != '' && !contains(steps.get-labels.outputs.labels, 'R0') }}
68
52
run : |
69
53
echo "Validating PR#${GITHUB_PR}"
70
54
python3 --version
0 commit comments