-
-
Notifications
You must be signed in to change notification settings - Fork 109
Fix: Failed to update news section automatically #1748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…l based on the num of available processors https://bundler.io/v2.7/man/bundle-install.1.html
@claude Review my PR? |
Claude finished @yasulab's task —— View job タスクリスト
PRレビューこのPRは、ニュースセクションの自動更新が機能しない問題(#1704)を修正するものですね。ワークフロー名を 🚨 重大な問題 (セキュリティ、破壊的変更)1. ワークフロー内のジョブ定義エラー(57-64行目)
# 53行目: 最初のジョブで定義
- name: 🚀 Deploy to Heroku if news found
if: ${{ env.FOUND_NEWS == 'true' }}
# TODO: This workflows depend on Ubuntu version.
# https://github.com/AkhileshNS/heroku-deploy/issues/186
runs-on: ubuntu-22.04 # ❌ これはステップ内で使えません
steps: # ❌ ステップ内でstepsは定義できません 修正案:別ジョブとして定義するか、単一のステップとして修正する必要があります。 # オプション1: 単一ステップとして修正
- name: 🚀 Deploy to Heroku if news found
if: ${{ env.FOUND_NEWS == 'true' }}
uses: akhileshns/[email protected]
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: ${{ secrets.HEROKU_APP_NAME }}
heroku_email: ${{ secrets.HEROKU_EMAIL }} 2. mainブランチへの直接push(36-40行目)git checkout main
git add db/news.yml
# ...
git push origin main mainブランチへの直接pushは危険です。保護されたブランチの場合、このワークフローは失敗します。
|
主な改善: - デプロイを独立したジョブに分離し、GitHub Actionsのベストプラクティスに準拠 - job outputs を使用した適切なジョブ間データ共有の実装 - $GITHUB_ENV から $GITHUB_OUTPUT への移行(GitHub推奨の最新仕様) - 重複した bundle install を削除(bundler-cache: true で自動実行) - 環境変数名を FOUND_NEWS に統一(一貫性のある大文字表記) - heroku-deploy アクションを最新版(v3.14.15)に更新 効果: - ニュースが見つからない場合はデプロイジョブ自体がスキップされ、実行時間を短縮 - ワークフローの構造が明確になり、保守性が向上 - GitHub Actions の最新仕様に準拠し、将来的な互換性を確保
30f5d0a
to
e9f9223
Compare
…le with deployment automatically
Fixed! 🚀✅✨ https://coderdojo.jp/#news ![]() |
#1704 does not update news section automatically because it does not have a workflow to update DB in production. So this PR fixes it.
📰 DojoLetter has Vol.88 but not updated in the news section
The news section: https://coderdojo.jp/#news
DojoLetter: https://news.coderdojo.jp/category/dojoletterバックナンバー/