Skip to content

Commit

Permalink
Merge pull request #22 from junqi-lu/source
Browse files Browse the repository at this point in the history
fix: #21
  • Loading branch information
Yidadaa committed Jul 13, 2023
2 parents 0b6ce58 + 49d19af commit da07330
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
16 changes: 13 additions & 3 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
本小节所示的安装方法可以满足大多数人的需求,你只需要在你的 `<your-name>.github.io` 仓库中新建三个配置文件,即可开始使用,具体步骤如下:
``` bash
.github
|- workflow
|- workflows
|- custom.js # 项目配置文件
|- cv.md # 简历模板配置文件
|- main.yml # github actions 配置文件
Expand Down Expand Up @@ -74,14 +74,14 @@ git push origin -u source
```

#### `repoConfig`
构建出的静态页面推送配置,其中 `repo``owner` 应与 `vssueConfig` 中保持一致,`pushBranch` 保留为 `master` 即可`email` 填写为你的 Github 账号绑定的邮箱,用于填写 commit message。
构建出的静态页面推送配置,其中 `repo``owner` 应与 `vssueConfig` 中保持一致,`pushBranch` 保留为主分支即可(github之前的默认主分支是 `master`,现在是 `main``email` 填写为你的 Github 账号绑定的邮箱,用于填写 commit message。

如果你不想让其他人发布的 issue 出现在你的主页,可以在 `filterUsers` 字段设置用户 ID 白名单,若设置为空或者不设置,则表示任何人发布的 issue 都会被发布出来。
```js
{
repo: String, // same as vssueConfig.repo
owner: String, // same as vssueConfig.owner
pushBranch: String, // which branch to deploy static pages, default is 'master'
pushBranch: String, // which branch to deploy static pages, default is 'master' or 'main'
email: String, // your email of github account, just for commit message
filterUsers: Array<String> // filter issues according to github account ids
}
Expand Down Expand Up @@ -168,6 +168,16 @@ yarn run dev
### 1. 如果防止别人发布的 issue 出现在我的主页?
你可以配置 `repoConfig.filterUsers` 字段来设置白名单。

### 2. 更新配置代码时,github action未自动执行?

你可以检查仓库的 `.github/workflows/main.yml``on->push->branches` 是否是你代码变动的分支。默认该配置为 `master`
但是现在 github 的默认分支为 `main`

### 3. 可以成功执行 github action, 但是仓库代码未更新并添加静态页面文件?

请查看 github action 的日志,确认 GITHUB_TOKEN 是否拥有写的权限,若没有,请参考 [GITHUB_TOKEN官方文档](https://docs.github.com/zh/actions/security-guides/automatic-token-authentication),在 `.github/workflows/main.yml` 文件中赋予对仓库的读写权限。
模板 [`./template/main.yml`](./template/main.yml) 默认赋予所有读写权限。

## 鸣谢
- 本项目基于 [vuepress](https://vuepress.vuejs.org/) 开发。
- 网页计数功能由 [busuanzi](http://busuanzi.ibruce.info/) 提供。
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Below are just some of the methods for installing ISSUE BLOG. Do not follow all
### Simple Installation (without Fork)
``` bash
.github
|- workflow
|- workflows
|- custom.js # site config
|- cv.md # resume config
|- main.yml # github actions config
Expand Down Expand Up @@ -77,7 +77,7 @@ Config for push repo, here is the example:
{
repo: String, // same as vssueConfig.repo
owner: String, // same as vssueConfig.owner
pushBranch: String, // which branch to deploy static pages, default is 'master'
pushBranch: String, // which branch to deploy static pages, default is 'master' or 'main'
email: String, // your email of github account, just for commit message
filterUsers: Array<String> // filter issues according to github account ids
}
Expand Down Expand Up @@ -154,6 +154,14 @@ You can refer [vuepress doc](https://vuepress.vuejs.org/) for more details.
### 1. How to prevent others from publishing issues to the site?
You can set a white-list by setting `repoConfig.filterUsers` to `['Your Github ID', 'Another Friend's ID']`, default setting allows everyone to post a blog to your site.

### 2. When updating the configuration, why GitHub Actions did not automatically run?

You can check the `.github/workflows/main.yml` file in your repository and ensure that the `on->push->branches` section corresponds to the branch where your code changes are made. Default branch was `master`, but now is `main` on GitHub.

### 3. GitHub Actions run successfully, but the repository code is not updated, and static page files are not added?

Please check the logs of your GitHub Actions and verify if the `GITHUB_TOKEN` has write permissions. If it does not, please refer to the [official documentation about GITHUB_TOKEN](https://docs.github.com/zh/actions/security-guides/automatic-token-authentication) and grant read and write permissions to your repository in `.github/workflows/main.yml`. Template file [`./template/main.yml`](./template/main.yml) define read or write access for all of the available scopes.

## Acknowledgment
- This project is based on [vuepress](https://vuepress.vuejs.org/).
- Visitor report is powered by [busuanzi](http://busuanzi.ibruce.info/).
2 changes: 2 additions & 0 deletions template/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
build:
runs-on: ubuntu-latest

permissions: write-all

strategy:
matrix:
node-version: [19.x]
Expand Down

0 comments on commit da07330

Please sign in to comment.