mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
* Add vitepress tree * Update existing workflows so they dont trigger on changes in the docs path * Add nojekyll, package.json, LICENCE etc * Add crowdin docs upload/download scripts * Add docs flaw checker workflows * Used docs prefix for docs workflows * Crowdin obvious fixes * ci: docs move to self hosted runner runs on a beefy server for faster builds Signed-off-by: Ramon Roche <mrpollo@gmail.com> * ci: don't run build action for docs or ci changes Signed-off-by: Ramon Roche <mrpollo@gmail.com> * ci: update runners Signed-off-by: Ramon Roche <mrpollo@gmail.com> * Add docs/en * Add docs assets and scripts * Fix up editlinks to point to PX4 sources * Download just the translations that are supported * Add translation sources for zh, uk, ko * Update latest tranlsation and uorb graphs * update vitepress to latest --------- Signed-off-by: Ramon Roche <mrpollo@gmail.com> Co-authored-by: Ramon Roche <mrpollo@gmail.com>
108 lines
3.6 KiB
YAML
108 lines
3.6 KiB
YAML
name: Docs - Comment Workflow
|
|
on:
|
|
workflow_run:
|
|
workflows: ["Check for flaws"]
|
|
types:
|
|
- completed
|
|
jobs:
|
|
comment:
|
|
permissions:
|
|
pull-requests: write # for marocchino/sticky-pull-request-comment
|
|
name: Comments
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: 'Download PR artifact'
|
|
uses: actions/github-script@v6
|
|
with:
|
|
script: |
|
|
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
run_id: context.payload.workflow_run.id,
|
|
});
|
|
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
|
|
return artifact.name == "pr_number"
|
|
})[0];
|
|
let download = await github.rest.actions.downloadArtifact({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
artifact_id: matchArtifact.id,
|
|
archive_format: 'zip',
|
|
});
|
|
let fs = require('fs');
|
|
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/pr_number.zip`, Buffer.from(download.data));
|
|
|
|
- name: 'Unzip artifact'
|
|
run: unzip pr_number.zip
|
|
|
|
# Doesn't work across workflows
|
|
#- name: Get artifacts from flaw checker workflow
|
|
# uses: actions/download-artifact@v3
|
|
# with:
|
|
# name: logs_and_errors
|
|
# #path: ./logs
|
|
|
|
- name: Read errorsFilteredByPrPages.md file
|
|
id: read-errors-by-page
|
|
uses: juliangruber/read-file-action@v1
|
|
with:
|
|
path: ./errorsFilteredByPrPages.md
|
|
|
|
- name: Read PR number
|
|
id: read-error-pr-number
|
|
uses: juliangruber/read-file-action@v1
|
|
with:
|
|
path: ./pr_number
|
|
|
|
- name: File detail info
|
|
run: |
|
|
echo "${{ steps.read-errors-by-page.outputs.content }}"
|
|
echo "${{ steps.read-error-pr-number.outputs.content }}"
|
|
|
|
- name: Create or update comment
|
|
id: comment_to_pr
|
|
uses: marocchino/sticky-pull-request-comment@v2
|
|
with:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
recreate: true
|
|
number: ${{ steps.read-error-pr-number.outputs.content }}
|
|
header: flaws
|
|
message: ${{ steps.read-errors-by-page.outputs.content || 'No flaws found' }}
|
|
|
|
#- name: Dump GitHub context
|
|
# env:
|
|
# GITHUB_CONTEXT: ${{ toJSON(github) }}
|
|
# run: echo "$GITHUB_CONTEXT"
|
|
|
|
# Would like to do this, but it doesn't work (for me).
|
|
# Moving to time-based, or triggering on workflow
|
|
#- name: Wait for artifacts upload to succeed
|
|
# uses: lewagon/wait-on-check-action@v1.3.1
|
|
# with:
|
|
# ref: ${{ github.ref }}
|
|
# check-name: 'Archive production artifacts'
|
|
# repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
# wait-interval: 80
|
|
|
|
# Not needed for now - trying to trigger off the workflow
|
|
#- name: Sleep for 80 seconds
|
|
# run: sleep 80s
|
|
# shell: bash
|
|
#- name: Find Comment
|
|
# uses: peter-evans/find-comment@v2
|
|
# id: fc
|
|
# with:
|
|
# issue-number: ${{ steps.read-error-pr-number.outputs.content }}
|
|
# comment-author: 'github-actions[bot]'
|
|
# body-includes: Flaws (may be none)
|
|
|
|
#- name: Create or update comment
|
|
# uses: peter-evans/create-or-update-comment@v3
|
|
# with:
|
|
# comment-id: ${{ steps.fc.outputs.comment-id }}
|
|
# issue-number: ${{ steps.read-error-pr-number.outputs.content }}
|
|
# body: |
|
|
# Flaws (may be none)
|
|
# ${{ steps.read-errors-by-page.outputs.content }}
|
|
# edit-mode: replace
|