Skip to content

Commit fb56009

Browse files
authored
fix: accessing token in builDb.js
fix: accessing token in builDb.js
2 parents e271f00 + d31cc2e commit fb56009

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

.github/actions/buildDB/action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: "Build DB"
22
description: "Compiles separate files into one json file"
3-
inputs:
4-
GITHUB_TOKEN:
5-
description: "The GITHUB_TOKEN secret"
63
runs:
7-
using: "node12"
4+
using: "node16"
85
main: "buildDB.js"
6+
7+
8+

.github/actions/buildDB/buildDB.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const github = require('@actions/github');
66
const dir = path.join(__dirname, "..", "..", "..", "public", "directory");
77
const files = fs.readdirSync(dir);
88

9-
const gh = github.getOctokit(core.getInput('GITHUB_TOKEN', { required: true }));
9+
const gh = process.env.GITHUB_TOKEN;
1010
const nameDb = [];
1111

1212
const build = async () => {
@@ -41,6 +41,5 @@ build()
4141
);
4242
})
4343
.catch((e) => {
44-
// core.setFailed(`Failed to compile a DB, \n${e.message} `);
45-
console.log(e);
44+
core.setFailed(`Failed to compile a DB, \n${e.message} `);
4645
});

.github/workflows/gh-page.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ jobs:
2323

2424
- name: Build DB
2525
uses: ./.github/actions/buildDB
26-
with:
27-
GITHUB_TOKEN: ${{ secrets.AVATAR_TOKEN }}
2826

2927
- name: Build static site
3028
run: yarn run build

0 commit comments

Comments
 (0)