Wiki: fix broken links to Rhino #118
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: Publish wiki | |
on: | |
push: | |
branches: | |
- 'main' | |
paths: | |
- wiki/** | |
- .github/workflows/publish-wiki.yml | |
# Do a dry-run (check, no deploy) for PRs. | |
pull_request: | |
paths: | |
- wiki/** | |
- .github/workflows/publish-wiki.yml | |
# Allow running this workflow manually from the Actions tab. | |
workflow_dispatch: | |
# Allow this workflow to be triggered from outside. | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: "publish-wiki" | |
cancel-in-progress: false | |
jobs: | |
publish-wiki: | |
name: "Publish Wiki" | |
if: github.repository == 'PHPCSStandards/PHP_CodeSniffer-documentation' | |
runs-on: ubuntu-latest | |
permissions: | |
# Needed for the commit to the wiki. | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Copy wiki files to temporary location | |
shell: bash | |
run: cp -v -a wiki _wiki | |
- name: Preface markdown files with warning not to edit in place | |
shell: bash | |
# yamllint disable rule:line-length | |
# shellcheck disable=SC2016 | |
run: > | |
find ./_wiki/ -name "*.md*" | |
-exec sed -i | |
'1i\<!--\nWARNING: DO NOT EDIT THIS FILE IN THE WIKI.\nThis wiki is updated from the https://github.com/PHPCSStandards/PHP_CodeSniffer-documentation repository.\nSubmit a PR to that repository updating the relevant file in the /wiki/ subdirectory instead.\n-->\n' {} \; | |
# yamllint enable rule:line-length | |
- name: Check GitHub Git Operations status | |
uses: crazy-max/ghaction-github-status@v4 | |
with: | |
git_threshold: partial_outage | |
- name: Deploy to wiki | |
uses: Andrew-Chen-Wang/[email protected] | |
env: | |
COMMIT_MSG: ${{ github.event.head_commit.message }} | |
DEFAULT_COMMIT_MSG: "Update wiki ${{ github.sha }}" | |
with: | |
strategy: 'clone' | |
path: '_wiki/' | |
commit-message: ${{ env.COMMIT_MSG != '' && env.COMMIT_MSG || env.DEFAULT_COMMIT_MSG }} | |
repository: PHPCSStandards/PHP_CodeSniffer | |
token: ${{ secrets.PHPCS_PUSH_TO_WIKI_TOKEN }} | |
dry-run: ${{ github.event_name == 'pull_request' }} | |
disable-empty-commits: true | |
preprocess: false |