Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(workflows): fixed generate theme readme #105

Merged
merged 1 commit into from
Nov 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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