Skip to content

Commit

Permalink
ci(workflows): fixed generate theme readme
Browse files Browse the repository at this point in the history
  • Loading branch information
FajarKim committed Nov 12, 2023
1 parent 7e01ebd commit e3b4752
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/generate-theme-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,22 @@ jobs:
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: npm install, generate readme
run: |
npm ci
npm run theme-readme-gen
env:
CI: true

- name: Commit Changes
uses: EndBug/add-and-commit@v7
- name: Run Script
uses: skx/github-action-tester@e29768ff4ff67be9d1fdbccd8836ab83233bebb1 # v0.10.0
with:
author_name: GitHub Actions
author_email: github-actions[bot]@users.noreply.github.com
message: "docs(theme): Auto uptade theme readme"
add: "themes/README.md"
github_token: ${{ secrets.GITHUB_TOKEN }}
script: ./scripts/push-theme-readme.sh
env:
CI: true
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
GH_REPO: ${{ secrets.GH_REPO }}
12 changes: 12 additions & 0 deletions scripts/push-theme-readme.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -x
set -e

git --version
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "GitHub Actions"
git config --global --add safe.directory ${GITHUB_WORKSPACE}
git add --all
git commit --no-verify --message "docs(theme): auto update theme readme"
git remote add master https://${PERSONAL_TOKEN}@github.com/${GH_REPO}.git
git push -f

0 comments on commit e3b4752

Please sign in to comment.