small fixes #54
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
name: Generate index.md and fix Jekyll's escape tags. | |
on: | |
push: | |
branches: [ "main" ] | |
workflow_dispatch: | |
env: | |
filename: "index.md" | |
contentdir: "content" | |
jobs: | |
push: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
fetch-depth: 1 | |
- name: "Generate ${{ env.filename }}" | |
shell: pwsh | |
run: | | |
Select-Object -InputObject $PSVersionTable -Property PSVersion,PSEdition,Platform,OS | |
Write-Host "`n`n" | |
./scripts/generate-index.ps1 | |
- name: "Fix Jekyll Escape tags in ${{ env.contentdir }}" | |
shell: bash | |
run: | | |
bash --version | |
set -euxo pipefail | |
echo -e "\n\nChecking Jekyll's escape tags." | |
bash scripts/FixJekyllEscapeTags.sh ${{ env.contentdir }} | |
- name: "Commit ${{ env.filename }}" | |
shell: bash | |
run: | | |
bash --version | |
set -euxo pipefail | |
echo -e "\n\nChecking diff for changes\n\n." | |
if (( $(git diff | wc -l) > 0 )); then | |
git config --global user.name ${{ github.actor }} | |
git config --global user.email "${{ github.actor }}@users.noreply.github.com" | |
git add --all | |
git commit -m "Adding ${{ env.filename }}" | |
git push | |
else | |
echo -e "\nNothing to commit, working tree clean." | |
fi |