generated from Drassil/git-wiki-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Github Action for virtual pages index
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Prepare virtual pages index | ||
on: push | ||
permissions: | ||
contents: write | ||
jobs: | ||
Prepare-Virtual-Pages-Index: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ github.token }} | ||
- name: Run build script | ||
run: | | ||
./build-virtual-index.ps1 | ||
shell: pwsh | ||
- name: Check for changes | ||
run: | | ||
if git diff --exit-code; then | ||
echo "CHANGED=false" >>${GITHUB_ENV} | ||
else | ||
echo "CHANGED=true" >>${GITHUB_ENV} | ||
fi | ||
shell: bash | ||
- name: Commit changes if they exist | ||
if: env.CHANGED == 'true' | ||
env: | ||
GH_USERNAME: ${{ github.repository_owner }} | ||
GH_USERID: ${{ github.repository_owner_id }} | ||
run: | | ||
git config --global user.email "${GH_USERID}+${GH_USERNAME}@users.noreply.github.com" | ||
git config --global user.name "${GH_USERNAME}" | ||
git add "./assets/js/virtualindex.js" | ||
git commit -m "Virtual pages index updated" | ||
git push | ||