From 4921058892b4542d01d336bd194fef9cb9fec92b Mon Sep 17 00:00:00 2001 From: Yohei Yasukawa Date: Fri, 17 Nov 2023 13:11:13 +0900 Subject: [PATCH 1/4] Add script to update dojo stats in GitHub profile --- update_profile.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 update_profile.rb diff --git a/update_profile.rb b/update_profile.rb new file mode 100755 index 0000000..0538193 --- /dev/null +++ b/update_profile.rb @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby + +require 'net/http' +require 'json' + +BASE_URL = 'https://coderdojo.jp' +DOJO_STATS = JSON.parse Net::HTTP.get(URI.parse "#{BASE_URL}/stats.json"), symbolize_names: true + +profile = File.read('profile/README.md') +profile.sub!(/日本全国(\d+)/, "日本全国#{DOJO_STATS[:active_dojos]}") + +File.open('profile/README.md', 'w') do |file| + file.write(profile) +end From c2a79df253db59354caf6c124425093dc442fb55 Mon Sep 17 00:00:00 2001 From: Yohei Yasukawa Date: Fri, 17 Nov 2023 13:16:33 +0900 Subject: [PATCH 2/4] Add scheduler_daily.yml to Actions --- .github/workflows/scheduler_daily.yml | 52 +++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/scheduler_daily.yml diff --git a/.github/workflows/scheduler_daily.yml b/.github/workflows/scheduler_daily.yml new file mode 100644 index 0000000..483ecd4 --- /dev/null +++ b/.github/workflows/scheduler_daily.yml @@ -0,0 +1,52 @@ +name: Daily Update + +# NOTE: GitHub Action's scheduler is always set to UTC+0. So 9am should be set at 0am for JST (UTC+9) +# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule + +# '0 23 * * *' == 8am in JST (UTC+9) +# '0 0 * * *' == 9am in JST (UTC+9) +# '0 1 * * *' == 10am in JST (UTC+9) +# '59 23 * * *' task will be completed after 9am in JST +on: + schedule: + - cron: '59 20 * * *' + + # [DEBUG ONLY] Every 5 minutes + # https://github.blog/changelog/2019-11-01-github-actions-scheduled-jobs-maximum-frequency-is-changing + #- cron: '*/5 * * * *' + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: 📥 Download codes from GitHub + uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - name: 💎 Set up Ruby + uses: ruby/setup-ruby@v1 + #with: + # bundler-cache: true + #ruby-version: 3.2 # Not necessary if .ruby-version is given + + - name: 📊 Update dojo stats of Japan + run: | + ./update_profile.rb + + - name: 🆙 Update profile if updated + run: | + if [ -n "$(git status --porcelain)" ]; then + git config --global user.name "Yohei Yasukawa" + git config --global user.email "yohei@yasslab.jp" + git checkout main + git add profile/README.md + git commit -m '🤖 Update profile data' + git push origin main + fi + env: + GITHUB_TOKEN: From 7f923f5fb631fe04a93b7a0cc6e5bac395a599c6 Mon Sep 17 00:00:00 2001 From: Yohei Yasukawa Date: Fri, 17 Nov 2023 13:17:54 +0900 Subject: [PATCH 3/4] Add .ruby-version: Ruby 3.2.2 --- .ruby-version | 1 + 1 file changed, 1 insertion(+) create mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..be94e6f --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.2.2 From 231027af65749d34eefbb836ec1851a38953fbc3 Mon Sep 17 00:00:00 2001 From: Yohei Yasukawa Date: Fri, 17 Nov 2023 04:18:20 +0000 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=A4=96=20Update=20profile=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- profile/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profile/README.md b/profile/README.md index 5555e56..ad97169 100644 --- a/profile/README.md +++ b/profile/README.md @@ -1,6 +1,6 @@ [![CoderDojo Japan Association](https://i.gyazo.com/747a6a1aaa2330439546a6a20914a0d8.png)](https://coderdojo.jp/) -CoderDojo は、日本全国190カ所以上で開催されている7~17歳を主な対象とした非営利のプログラミング道場です。2011年にアイルランドで始まり、世界では100カ国・2,000以上の道場があります。日本でも2012年から活動が始まり、[毎年1,000回以上のイベントが開催](https://coderdojo.jp/events)され、各イベントはプログラマーやデザイナー、学生や教員など、多様な方々の協力によって支えられています。 +CoderDojo は、日本全国191カ所以上で開催されている7~17歳を主な対象とした非営利のプログラミング道場です。2011年にアイルランドで始まり、世界では100カ国・2,000以上の道場があります。日本でも2012年から活動が始まり、[毎年1,000回以上のイベントが開催](https://coderdojo.jp/events)され、各イベントはプログラマーやデザイナー、学生や教員など、多様な方々の協力によって支えられています。 世界中にある [CoderDojo 公式法人](https://coderdojo.com/regional-bodies/)の1つ「[一般社団法人 CoderDojo Japan](https://coderdojo.jp/about-coderdojo-japan)」では、[25社以上のパートナー法人](https://coderdojo.jp/#partners)と連携し、全国の CoderDojo の活動を継続的にサポートしています。CoderDojo コミュニティ向け支援や連携をご検討されている組織・法人などありましたら、下記ページからお気軽にご連絡ください。 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy