Skip to content

Commit 03bb1bc

Browse files
committed
Fix security issues reported by CodeQL
1 parent 7056c2b commit 03bb1bc

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.github/workflows/github-pages.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Build and deploy Jekyll site to GitHub Pages
22

3+
permissions:
4+
contents: write
5+
36
on:
47
push:
58
branches:
@@ -13,13 +16,13 @@ jobs:
1316
- name: 📂 setup
1417
uses: actions/checkout@v4
1518
- name: 💎 setup ruby
16-
uses: ruby/setup-ruby@v1
19+
uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4 # v1.207.0
1720
with:
1821
ruby-version: 2.7
1922
- name: 🔨 install dependencies & build site
20-
uses: limjh16/jekyll-action-ts@v2
23+
uses: limjh16/jekyll-action-ts@807a5f09755d777bfd3070e9505d02347844c9b2 # v2.4.2
2124
- name: 🚀 deploy
22-
uses: peaceiris/actions-gh-pages@v4
25+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
2326
with:
2427
github_token: ${{ secrets.GITHUB_TOKEN }}
2528
publish_dir: ./_site

_plugins/jekyll_get.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def generate(site)
1818
config.each do |d|
1919
begin
2020
target = site.data[d['data']]
21-
source = JSON.load(open(d['json']))
21+
source = JSON.load(URI(d['json']))
2222
if target
2323
HashJoiner.deep_merge target, source
2424
else
@@ -27,7 +27,7 @@ def generate(site)
2727
if d['cache']
2828
data_source = (site.config['data_source'] || '_data')
2929
path = "#{data_source}/#{d['data']}.json"
30-
open(path, 'wb') do |file|
30+
FILE.open(path, 'wb') do | file |
3131
file << JSON.generate(site.data[d['data']])
3232
end
3333
end

0 commit comments

Comments
 (0)