Skip to content

Commit ca30f89

Browse files
committed
Merge branch 'main' into add-global_club_id-to-dojo-model
2 parents 3d97eee + 510b945 commit ca30f89

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1069
-346
lines changed

.github/workflows/daily.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Daily Workflow
2+
3+
on:
4+
schedule:
5+
# 毎朝 9:00 JST
6+
- cron: '0 0 * * *'
7+
# Allows you to run this workflow manually from the Actions tab
8+
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
9+
workflow_dispatch:
10+
11+
jobs:
12+
daily:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
FOUND_NEWS: ${{ steps.check_news.outputs.FOUND_NEWS }}
16+
17+
steps:
18+
- name: ☑️ Checkout code
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 2
22+
23+
- name: 💎 Setup Ruby
24+
uses: ruby/setup-ruby@v1
25+
with:
26+
bundler-cache: true
27+
28+
- name: 📰 Run news:fetch task
29+
run: bin/rails news:fetch
30+
31+
- name: 🆙 Commit updated news.yml
32+
id: check_news
33+
run: |
34+
git config user.name "Yohei Yasukawa"
35+
git config user.email "[email protected]"
36+
git checkout main
37+
git add db/news.yml
38+
if ! git diff --cached --quiet; then
39+
git commit -m '🤖 Upsert db/news.yml'
40+
git push origin main
41+
echo "🆕 Found news in db/news.yml"
42+
echo "FOUND_NEWS=true" >> $GITHUB_OUTPUT
43+
else
44+
echo "✅ No news in db/news.yml"
45+
echo "FOUND_NEWS=false" >> $GITHUB_OUTPUT
46+
fi
47+
48+
deploy:
49+
needs: daily
50+
if: ${{ needs.daily.outputs.FOUND_NEWS == 'true' }}
51+
# TODO: ubuntu-latest image needs to install heroku CLI to deploy.
52+
# https://github.com/AkhileshNS/heroku-deploy/issues/188
53+
runs-on: ubuntu-22.04
54+
55+
steps:
56+
- name: ☑️ Checkout code
57+
uses: actions/checkout@v4
58+
with:
59+
ref: main
60+
61+
- name: 🚀 Deploy to Heroku
62+
uses: akhileshns/[email protected]
63+
with:
64+
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
65+
heroku_app_name: ${{ secrets.HEROKU_APP_NAME }}
66+
heroku_email: ${{ secrets.HEROKU_EMAIL }}

.github/workflows/fetch_news.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 行動規範 - Code of Conduct
22

3-
[一般社団法人 CoderDojo Japan](https://coderdojo.jp/about-coderdojo-japan) は、次の行動規範にしたがって [GitHub 上の各種リポジトリ](https://github.com/coderdojo-japan)を運営しています。
3+
[一般社団法人 CoderDojo Japan](https://coderdojo.jp/about) は、次の行動規範にしたがって [GitHub 上の各種リポジトリ](https://github.com/coderdojo-japan)を運営しています。
44

55
コントリビューター行動規範 - CoderDojo Japan
66
https://coderdojo.jp/conduct

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ GEM
286286
get_process_mem (>= 0.2)
287287
puma (>= 2.7)
288288
racc (1.8.1)
289-
rack (3.1.16)
289+
rack (3.1.18)
290290
rack-attack (6.7.0)
291291
rack (>= 1.0, < 4)
292292
rack-host-redirect (1.3.0)
@@ -356,7 +356,7 @@ GEM
356356
io-console (~> 0.5)
357357
reverse_markdown (3.0.0)
358358
nokogiri
359-
rexml (3.4.1)
359+
rexml (3.4.2)
360360
rinku (2.0.6)
361361
rspec-core (3.13.4)
362362
rspec-support (~> 3.13.0)

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
4242
Check out README's LICENSE (ライセンス) section in GitHub:
4343
https://github.com/coderdojo-japan/coderdojo.jp#5-license
4444

45-
Copyright &copy; [一般社団法人 CoderDojo Japan](https://coderdojo.jp/about-coderdojo-japan)
45+
Copyright &copy; [一般社団法人 CoderDojo Japan](https://coderdojo.jp/about)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ We use `SCRIVITO_TENANT` and `SCRIVITO_API_KEY` keys in production, but they are
273273
This web application is developed with many other brilliant works! :sparkling_heart:
274274
You can check out them and our works with associated licenses from [LICENSE.md](https://github.com/coderdojo-japan/coderdojo.jp/blob/main/LICENSE.md). :wink:
275275

276-
Copyright &copy; [一般社団法人 CoderDojo Japan](https://coderdojo.jp/about-coderdojo-japan) ([@coderdojo-japan](https://github.com/coderdojo-japan)).
276+
Copyright &copy; [一般社団法人 CoderDojo Japan](https://coderdojo.jp/about) ([@coderdojo-japan](https://github.com/coderdojo-japan)).
277277

278278
<br>
279279

343 KB
Loading
130 KB
Loading

app/controllers/podcasts_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def convert_shownote(content)
5050
content.gsub!(Podcast::TIMESTAMP_REGEX) do
5151
original_t = $1
5252
parts = original_t.split(':')
53-
53+
5454
# タイムスタンプをh:m:s形式に変換
5555
if parts.size == 3
5656
# 00:00:00 形式
@@ -64,7 +64,7 @@ def convert_shownote(content)
6464
# それ以外(通常は来ないはず)
6565
t = original_t
6666
end
67-
67+
6868
"- [#{original_t}](https://youtu.be/#{youtube_id}?t=#{t}) &nbsp; "
6969
end
7070
end

app/models/document.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def last
2020
end
2121

2222
def initialize(filename)
23-
@filename = filename
23+
# ActiveStorage::Filename を使用してファイル名をサニタイズ
24+
@filename = ActiveStorage::Filename.new(filename).sanitized
2425
end
2526

2627
def path
@@ -56,7 +57,6 @@ def url
5657
end
5758

5859
def exist?
59-
return false if path.include? "\u0000"
6060
Document.all.map(&:filename).include?(filename)
6161
end
6262

0 commit comments

Comments
 (0)