Make the wiki publisher a scoped workflow with an opt-in gate
Validate workflows / validate (pull_request) Successful in 12s
Validate workflows / validate (pull_request) Successful in 12s
Embed the publish script in .gitea/scoped_workflows/publish-wiki.yml and remove the repository workflow and tools/publish_wiki.py. A repository publishes only when wiki/.publish exists; the word prune in it is the only thing that lets the workflow delete pages. The organisation's TOKEN_FOR_GITEA_WIKI is used with no fallback. This repository opts in with prune. Tests run the embedded script against a fake Gitea. Task: MIL-006#2 Task: MIL-006#3
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
name: Publish wiki
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
paths:
|
||||
- "wiki/**"
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: publish-wiki
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
publish-wiki:
|
||||
permissions:
|
||||
contents: read
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Check that the English pages are current
|
||||
run: python3 tools/build_wiki.py --check
|
||||
|
||||
- name: Publish the pages to the wiki
|
||||
env:
|
||||
GITEA_API_URL: ${{ gitea.api_url }}
|
||||
SOURCE_REPOSITORY: ${{ gitea.repository }}
|
||||
# TOKEN_FOR_GITEA_WIKI wins when it exists; otherwise TOKEN_FOR_GITEA is reused.
|
||||
WIKI_CREDENTIALS: ${{ secrets.TOKEN_FOR_GITEA_WIKI || secrets.TOKEN_FOR_GITEA }}
|
||||
run: python3 tools/publish_wiki.py
|
||||
Reference in New Issue
Block a user