mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 18:07:58 +00:00
756a12d571
## Overview This PR brings in the new version of prdoc v0.0.6 and allows: - local schema - local config - local template It also fixes the existing prdoc files to match the new schema. ## todo - [x] add a brief doc/tldr to help contributors get started - [x] test CI - [x] finalize schema - [x] publish the next `prdoc` cli version (v0.0.7 or above) --------- Co-authored-by: Egor_P <egor@parity.io> Co-authored-by: Bastian Köcher <git@kchr.de>
66 lines
2.4 KiB
YAML
66 lines
2.4 KiB
YAML
name: Check PRdoc
|
|
|
|
on:
|
|
pull_request:
|
|
types: [labeled, opened, synchronize, unlabeled]
|
|
merge_group:
|
|
|
|
env:
|
|
IMAGE: docker.io/paritytech/prdoc:v0.0.7
|
|
API_BASE: https://api.github.com/repos
|
|
REPO: ${{ github.repository }}
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
GITHUB_PR: ${{ github.event.pull_request.number }}
|
|
ENGINE: docker
|
|
PRDOC_DOC: https://github.com/paritytech/polkadot-sdk/blob/master/docs/prdoc.md
|
|
|
|
jobs:
|
|
check-prdoc:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
# we cannot show the version in this step (ie before checking out the repo)
|
|
# due to https://github.com/paritytech/prdoc/issues/15
|
|
- name: Skip merge queue
|
|
if: ${{ contains(github.ref, 'gh-readonly-queue') }}
|
|
run: exit 0
|
|
- name: Pull image
|
|
run: |
|
|
echo "Pulling $IMAGE"
|
|
$ENGINE pull $IMAGE
|
|
|
|
- name: Check if PRdoc is required
|
|
id: get-labels
|
|
run: |
|
|
# Fetch the labels for the PR under test
|
|
echo "Fetch the labels for $API_BASE/${REPO}/pulls/${GITHUB_PR}"
|
|
labels=$( curl -H "Authorization: token ${GITHUB_TOKEN}" -s "$API_BASE/${REPO}/pulls/${GITHUB_PR}" | jq '.labels | .[] | .name' | tr "\n" ",")
|
|
echo "Labels: ${labels}"
|
|
echo "labels=${labels}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Checkout repo
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
|
|
|
|
- name: Check PRDoc version
|
|
run: |
|
|
$ENGINE run --rm -v $PWD:/repo $IMAGE --version
|
|
|
|
- name: Early exit if PR is silent
|
|
if: ${{ contains(steps.get-labels.outputs.labels, 'R0') }}
|
|
run: |
|
|
hits=$(find prdoc -name "pr_$GITHUB_PR*.prdoc" | wc -l)
|
|
if (( hits > 0 )); then
|
|
echo "PR detected as silent, but a PRDoc was found, checking it as information"
|
|
$ENGINE run --rm -v $PWD:/repo $IMAGE check -n ${GITHUB_PR} || echo "Ignoring failure"
|
|
else
|
|
echo "PR detected as silent, no PRDoc found, exiting..."
|
|
fi
|
|
echo "If you want to add a PRDoc, please refer to $PRDOC_DOC"
|
|
exit 0
|
|
|
|
- name: PRdoc check for PR#${{ github.event.pull_request.number }}
|
|
if: ${{ !contains(steps.get-labels.outputs.labels, 'R0') }}
|
|
run: |
|
|
echo "Checking for PR#${GITHUB_PR}"
|
|
echo "You can find more information about PRDoc at $PRDOC_DOC"
|
|
$ENGINE run --rm -v $PWD:/repo $IMAGE check -n ${GITHUB_PR}
|