-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update workflow to copy README to Wiki
- Loading branch information
1 parent
6599dbb
commit c2ce024
Showing
1 changed file
with
20 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
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 |