Skip to content

Commit

Permalink
Update workflow to copy README to Wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianPrieber committed Sep 24, 2024
1 parent 6599dbb commit c2ce024
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/copy-readme-to-wiki.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
name: Copy README to Wiki
name: Update Wiki

on:
push:
paths:
- 'README.md'
branches:
- main

jobs:
copy-readme-to-wiki:
update-wiki:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
- name: Checkout the repo
uses: actions/checkout@v3

- name: Copy README.md to Wiki
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Set the wiki URL and the wiki README file path
run: |
# Set the wiki URL and the wiki README file path
WIKI_URL="https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git"
WIKI_URL="https://github.com/$GITHUB_REPOSITORY.wiki.git"
README_FILE="README.md"
WIKI_README_FILE="Home.md"
# Create a temporary directory for the wiki
mkdir wiki
cd wiki
# Clone the wiki
git clone $WIKI_URL .
# Copy the README.md to the wiki
cp ../$README_FILE $WIKI_README_FILE
# Commit and push changes
- name: Set up Git user
run: |
git config --global user.email "julian.prieber@llc.ovh"
git config --global user.name "Julian Prieber"
- name: Copy README to wiki
run: cp ../$README_FILE $WIKI_README_FILE

- name: Commit and push changes
run: |
git add $WIKI_README_FILE
git commit -m "Update Wiki README from main README" || echo "No changes to commit"
git push

0 comments on commit c2ce024

Please sign in to comment.