update node ver and (possible) script vulnerability

This commit is contained in:
SX-9 2025-02-12 10:21:35 +07:00
commit d8b02125b7
2 changed files with 11 additions and 6 deletions

View file

@ -19,7 +19,7 @@ jobs:
- name: Set up Node.js - name: Set up Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: '14' node-version: '18'
- name: Install dependencies - name: Install dependencies
run: npm install run: npm install
@ -39,19 +39,22 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Download database artifact - name: Download database artifact
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
name: database name: database
path: database.json path: database.json
- name: Commit and push database.json - name: Commit and push database.json to another repository
run: | run: |
git clone https://github.com/partofmyid/database.git db
cd db
git config --global user.name 'github-actions' git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com' git config --global user.email 'github-actions@github.com'
git config --unset-all http.https://github.com/.extraheader
mv ../database.json .
git add database.json git add database.json
git commit -m 'Update database.json' git commit -m 'Update database.json'
git push git push
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}

View file

@ -1,9 +1,11 @@
const fs = require('fs');
console.log( console.log(
JSON.stringify( JSON.stringify(
require('fs').readdirSync('./domains').map(f => fs.readdirSync('./domains').map(f =>
[ [
f.split('.').slice(0, -1).join('.'), // subdomain f.split('.').slice(0, -1).join('.'), // subdomain
require(`./domains/${f}`).owner.username // owner JSON.parse(fs.readFileSync(`./domains/${f}`, 'utf8')).owner.username // owner
] ]
) )
) )