actions/wiki/action.yaml

43 lines
1.2 KiB
YAML
Raw Normal View History

2023-12-20 00:15:03 -05:00
name: Publish Wiki
desciption: Publish Wiki
inputs:
2023-12-20 00:19:33 -05:00
url:
type: string
required: false
description: Repository URL that will be cloned
default: ${{github.server_url}}/${{github.repository}}.wiki.git
token:
type: string
required: false
description: Authentication token
default: ${{github.token}}
pattern:
type: string
required: false
description: Directory to upload to wiki
default: docs
2023-12-20 00:15:03 -05:00
runs:
2023-12-20 00:19:33 -05:00
using: composite
steps:
- name: Creat authorized Git URL
run: echo "URL=$(echo ${{inputs.url}} | sed s%://%://${{inputs.token}}@% )" >> $GITHUB_ENV
shell: sh
2023-12-20 00:15:03 -05:00
2023-12-20 00:19:33 -05:00
- name: Clone repository
uses: docker://alpine/git
with:
entrypoint: git
args: clone "${{env.URL}}" wiki
- name: Update files
2023-12-20 00:32:15 -05:00
run: mv -f ${{inputs.pattern}}/* wiki/
2023-12-20 00:19:33 -05:00
shell: sh
- name: Push
uses: docker://alpine/git
with:
2023-12-20 00:24:18 -05:00
entrypoint: /bin/sh
2023-12-20 00:29:50 -05:00
args: -c "cd wiki && git config user.name Ghost && git config user.email git@zakscode.com && git add . && git commit -m 'Automated wiki update' && git push"