Skip to content

feat(theme): Added neon-palenight theme (#193) #40

feat(theme): Added neon-palenight theme (#193)

feat(theme): Added neon-palenight theme (#193) #40

name: Generate Theme Readme
on:
workflow_dispatch:
push:
branches:
- master
paths:
- "themes/index.ts"
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: write
repository-projects: read
security-events: read
statuses: read
jobs:
generateThemeDoc:
runs-on: ubuntu-latest
name: Generate theme doc
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Node
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: ${{ matrix.node-version }}
cache: npm
# Fix the unsafe repo error which was introduced by the CVE-2022-24765 git patches.
- name: Fix unsafe repo error
run: git config --global --add safe.directory ${{ github.workspace }}
- name: Run npm install and generate readme
run: |
npm ci
npm run theme-readme-gen
env:
CI: true
- name: Set up Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Push commit to a new branch
run: |
export branch="auto_update_theme_readme"
export message="docs(theme): auto update theme readme"
if [[ "$(git status --porcelain)" != "" ]]; then
git branch -D ${branch} || true
git checkout -b ${branch}
git add themes/README.md
git commit --message "${message}"
git remote add origin-${branch} "https://github.com/FajarKim/github-readme-profile.git"
git push --force --quiet --set-upstream origin-${branch} ${branch}
fi
- name: Create Pull Request
run: |
gh pr create --title "${message}" --body ""
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}