Introduce API for directly importing the state into the database #65136
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check PRdoc | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| pull_request: | |
| types: [labeled, opened, synchronize, unlabeled] | |
| merge_group: | |
| env: | |
| IMAGE: docker.io/paritytech/prdoc:v0.1.1 | |
| 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/contributor/prdoc.md | |
| jobs: | |
| check-prdoc: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Check prdoc format | |
| run: | | |
| echo "Pulling $IMAGE" | |
| $ENGINE pull $IMAGE | |
| echo "Checking PRdoc version" | |
| $ENGINE run --rm -v $PWD:/repo $IMAGE --version | |
| echo "Check prdoc format" | |
| echo "For PRDoc format, please refer to $PRDOC_DOC" | |
| $ENGINE run --rm -v $PWD:/repo -e RUST_LOG=info $IMAGE check | |
| - name: Check if PRdoc is required | |
| if: github.event.pull_request.number != '' | |
| 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: Get Original PR number | |
| if: ${{ github.event.pull_request.number != '' && !contains(steps.get-labels.outputs.labels, 'R0') }} | |
| shell: bash | |
| env: | |
| PR_TITLE: ${{ github.event.pull_request.title }} | |
| run: | | |
| . ./.github/scripts/common/lib.sh | |
| original_pr_number='' | |
| echo "Checking PR title: $PR_TITLE" | |
| if [[ "$PR_TITLE" =~ 'Backport' ]]; then | |
| # Extracting the original PR number from the backport's PR title | |
| original_pr_number=$(extract_pr_number_from_pr_title "$PR_TITLE") | |
| echo "Extracted PR number: $original_pr_number" | |
| else | |
| original_pr_number=${{ github.event.pull_request.number }} | |
| fi | |
| echo "PR_NUMBER=$original_pr_number" >> $GITHUB_ENV | |
| - name: Validate prdoc for PR#${{ env.PR_NUMBER }} | |
| if: ${{ github.event.pull_request.number != '' && !contains(steps.get-labels.outputs.labels, 'R0') }} | |
| run: | | |
| echo "Validating PR#${{ env.PR_NUMBER }}" | |
| python3 --version | |
| python3 -m pip install cargo-workspace==1.2.1 | |
| python3 .github/scripts/check-prdoc.py Cargo.toml prdoc/pr_${{ env.PR_NUMBER }}.prdoc |