Skip to content

Commit 9bd800a

Browse files
azuclaude
andauthored
ci: PR時にJekyll buildをチェックするワークフローを追加 (#1345)
* ci: add Jekyll build check for PRs and fix zizmor warnings - Add new jekyll-build.yml workflow to check Jekyll build on pull requests - Update deploy.yml and jekyll-build.yml to reference .ruby-version file - Pin mastofeedbot action to commit hash - Add persist-credentials: false to checkout actions - Add permissions to rss-to-mastodon.yml and rss-to-twitter.yml jobs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * ci: keep credentials for deploy workflow Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * ci: enable bundler cache for ruby setup Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent d9cf081 commit 9bd800a

6 files changed

Lines changed: 58 additions & 19 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ jobs:
99
deploy:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 # zizmor: ignore[artipacked]
1313
with:
1414
lfs: 'true'
1515
- name: Setup Node.js
16-
uses: actions/setup-node@v3
16+
uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
1717
with:
1818
node-version: 18
1919
- name: Install
@@ -23,15 +23,14 @@ jobs:
2323
- name: Build
2424
run: npm run build
2525
- name: Install Ruby
26-
uses: ruby/setup-ruby@v1
26+
uses: ruby/setup-ruby@708024e6c902387ab41de36e1669e43b5ee7085e # v1.283.0
2727
with:
28-
ruby-version: 2.7.8
29-
- name: Bundle install
30-
run: bundle install
28+
ruby-version-file: '.ruby-version'
29+
bundler-cache: true
3130
- name: Build Jekyll
3231
run: bundle exec jekyll build
3332
- name: Deploy to GitHub Pages
34-
uses: peaceiris/actions-gh-pages@v3
33+
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3.9.3
3534
if: github.ref == 'refs/heads/develop'
3635
with:
3736
github_token: ${{ secrets.SHARED_BOT_GITHUB_TOKEN }}

.github/workflows/jekyll-build.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Jekyll Build
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
14+
with:
15+
lfs: 'true'
16+
persist-credentials: false
17+
- name: Setup Node.js
18+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
19+
with:
20+
node-version: 18
21+
- name: Install npm dependencies
22+
run: yarn install
23+
- name: Build
24+
run: npm run build
25+
- name: Install Ruby
26+
uses: ruby/setup-ruby@708024e6c902387ab41de36e1669e43b5ee7085e # v1.283.0
27+
with:
28+
ruby-version-file: '.ruby-version'
29+
bundler-cache: true
30+
- name: Build Jekyll
31+
run: bundle exec jekyll build

.github/workflows/rss-to-mastodon.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,25 @@ on:
77
jobs:
88
realtime:
99
runs-on: ubuntu-latest
10+
permissions:
11+
actions: write
1012
steps:
1113
- name: Generate cache key
12-
uses: actions/github-script@v6
14+
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
1315
id: generate-key
1416
with:
1517
script: |
1618
core.setOutput('cache-key', new Date().valueOf())
1719
1820
- name: Retrieve cache
19-
uses: actions/cache@v3
21+
uses: actions/cache@6f8efc29b200d32929f49075959781ed54ec270c # v3.5.0
2022
with:
2123
path: ${{ github.workspace }}/mastofeedbot
2224
key: feed-cache-realtime-jser-info-${{ steps.generate-key.outputs.cache-key }}
2325
restore-keys: feed-cache-realtime-jser-info-
2426

2527
- name: JSer.info
26-
uses: 'jser/mastofeedbot@main'
28+
uses: 'jser/mastofeedbot@0e1dbc3e480b4a35d5a01dd539f2341f5b785afd' # main
2729
with:
2830
rss-feed: https://realtime.jser.info/feed.xml
2931
api-endpoint: https://mstdn.jp
@@ -33,23 +35,25 @@ jobs:
3335

3436
jser:
3537
runs-on: ubuntu-latest
38+
permissions:
39+
actions: write
3640
steps:
3741
- name: Generate cache key
38-
uses: actions/github-script@v6
42+
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
3943
id: generate-key
4044
with:
4145
script: |
4246
core.setOutput('cache-key', new Date().valueOf())
4347
4448
- name: Retrieve cache
45-
uses: actions/cache@v3
49+
uses: actions/cache@6f8efc29b200d32929f49075959781ed54ec270c # v3.5.0
4650
with:
4751
path: ${{ github.workspace }}/mastofeedbot
4852
key: feed-cache-jser-info-${{ steps.generate-key.outputs.cache-key }}
4953
restore-keys: feed-cache-jser-info-
5054

5155
- name: JSer.info
52-
uses: 'jser/mastofeedbot@main'
56+
uses: 'jser/mastofeedbot@0e1dbc3e480b4a35d5a01dd539f2341f5b785afd' # main
5357
with:
5458
rss-feed: https://jser.info/rss/
5559
api-endpoint: https://mstdn.jp

.github/workflows/rss-to-twitter.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ on:
44
jobs:
55
twitter:
66
runs-on: ubuntu-latest
7+
permissions: {}
78
# if github.event.build.error.message is not null, it means that the build failed. Skip it
89
if: ${{ github.event.build.error.message == null }}
910
steps:
1011
# https://github.com/azu/rss-to-twitter
11-
- uses: azu/rss-to-twitter@v1
12+
- uses: azu/rss-to-twitter@f20e6ba3ed2dc03d86578775a5d2a3afb5bff966 # v1.1.0
1213
with:
1314
RSS_URL: "https://jser.info/rss/"
1415
TWEET_TEMPLATE: '更新しました! "%title%" %url%'

.github/workflows/textlint.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@ jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
15+
with:
16+
persist-credentials: false
1517
- name: Setup Node.js
16-
uses: actions/setup-node@v3
18+
uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
1719
with:
1820
node-version: 18
1921
- name: Install
2022
run: yarn install
2123
- name: textlint reviewdog
22-
uses: tsuyoshicho/action-textlint@v3
24+
uses: tsuyoshicho/action-textlint@689c87690ef3b954b5039bcb15589863c9e021a1 # v3.11.1
2325
with:
2426
github_token: ${{ secrets.github_token }}
2527
reporter: github-pr-review

.github/workflows/update-draft-pr.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ jobs:
1414
if: github.event_name == 'pull_request' && (github.event.pull_request.author_association == 'MEMBER' || github.event.pull_request.author_association == 'OWNER' || github.event.pull_request.author_association == 'COLLABORATOR')
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
18+
with:
19+
persist-credentials: false
1820
- name: Setup Node.js
19-
uses: actions/setup-node@v3
21+
uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
2022
with:
2123
node-version: 18
2224
- name: Install

0 commit comments

Comments
 (0)