TirSystem/github-action: Sync GitHub mirror metadata / sync-metadata (push) Skipped
code-metrics.yml defaulted tools-ref to v1 and its guide said @v1, but the workflow and its scripts exist only from v2.1.0. The default of the five reusable workflows is now the current major, defined once in MAJOR_TAG, and tests/test_tools_ref.py fails when a default differs from it or names a tag without the script. Guides, README and wiki (en, da, ms) call code-metrics.yml at @v2; ADR-0005, 0008, 0009 and 0010 carry an amendment; RC-077 accepts the milestone's task 1 results. Task: MIL-011#2
65 lines
2.1 KiB
YAML
65 lines
2.1 KiB
YAML
name: Publish wiki
|
|
|
|
# Reusable workflow (ADR-0009, MIL-008). A repository calls it with
|
|
#
|
|
# on:
|
|
# push:
|
|
# branches: [ main ]
|
|
# paths: [ "docs/wiki/**" ]
|
|
# jobs:
|
|
# wiki:
|
|
# uses: TirSystem/github-action/.gitea/workflows/publish-wiki-pages.yml@v1
|
|
# secrets:
|
|
# TOKEN_FOR_GITEA_WIKI: ${{ secrets.TOKEN_FOR_GITEA_WIKI }}
|
|
#
|
|
# The caller file is the opt-in; there is no marker file. It publishes the
|
|
# Markdown pages of wiki_dir to the wiki of the calling repository, creating
|
|
# and updating pages, and deleting pages that are not in the folder only when
|
|
# prune is true. The script is a file of this repository
|
|
# (tools/publish_wiki.py), fetched at tools-ref.
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
wiki_dir:
|
|
description: "Directory, relative to the repository root, with the wiki pages"
|
|
type: string
|
|
default: "docs/wiki"
|
|
prune:
|
|
description: "true deletes wiki pages that are not in the folder; false keeps them"
|
|
type: string
|
|
default: "false"
|
|
tools-ref:
|
|
description: "Tag or branch of TirSystem/github-action whose tools/publish_wiki.py is run; pin it to the exact tag together with the workflow"
|
|
type: string
|
|
default: "v2"
|
|
secrets:
|
|
TOKEN_FOR_GITEA_WIKI:
|
|
description: "Gitea token with write access to the wiki of the calling repository"
|
|
required: true
|
|
|
|
jobs:
|
|
publish-wiki:
|
|
permissions:
|
|
contents: read
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- name: Check out the repository
|
|
uses: actions/checkout@v4.2.2
|
|
|
|
- name: Fetch the shared script
|
|
uses: actions/checkout@v4.2.2
|
|
with:
|
|
repository: TirSystem/github-action
|
|
ref: ${{ inputs.tools-ref }}
|
|
path: shared-scripts
|
|
|
|
- name: Publish the pages to the wiki
|
|
env:
|
|
GITEA_API_URL: ${{ gitea.api_url }}
|
|
SOURCE_REPOSITORY: ${{ gitea.repository }}
|
|
WIKI_CREDENTIALS: ${{ secrets.TOKEN_FOR_GITEA_WIKI }}
|
|
WIKI_DIR: ${{ inputs.wiki_dir }}
|
|
WIKI_PRUNE: ${{ inputs.prune }}
|
|
run: python3 shared-scripts/tools/publish_wiki.py
|