Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
fix: disable cache on conf
Browse files Browse the repository at this point in the history
Anyone with read access can create a pull request on a repository and access the cache
  • Loading branch information
beetcb committed Feb 22, 2021
1 parent 2ec1ed3 commit 1519139
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/cea.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
uses: actions/cache@v2
with:
path: |
/tmp/conf
**/node_modules
key: ${{ runner.os }}-${{ steps.get-date.outputs.date }}

Expand Down
8 changes: 5 additions & 3 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ conf.init = async function () {

if (env.users && env.school) {
log.warning('尝试从环境变量加载配置')
userUlti.loadUserFromEnv(env)
await schoolUlti.loadSchoolFromEnv(env)
const users = userUlti.loadUserFromEnv(env)
await schoolUlti.loadSchoolFromEnv(env, users)
} else if (toml) {
log.warning('尝试从配置文件加载配置')
userUlti.loadUserFromToml(toml)
Expand Down Expand Up @@ -65,6 +65,7 @@ class User {
return { username, password, alias, addr }
})
this.storeUsers(loadedUsers)
return loadedUsers
}
}

Expand Down Expand Up @@ -204,8 +205,9 @@ class School {
/**
* Grab school info from environment
* @param {string} name school nmae, english abbreviation
* @param {array} users list of loaded users
*/
async loadSchoolFromEnv({ school: name, users }) {
async loadSchoolFromEnv({ school: name }, users) {
if (!conf.get('school')) {
const school = await this.schoolApi(name)
if (users.some(e => e.addr === ''))
Expand Down

0 comments on commit 1519139

Please sign in to comment.