Merged
Conversation
…gger - Add explicit DEV_TO_API_KEY presence check with a clear error message - Add workflow_dispatch trigger to allow manual re-runs with specific files - Fix shell injection: use env var TARGET_FILES instead of direct expression interpolation - Print detected files for easier debugging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
devto-publishワークフローが連続して失敗している問題を調査・対応したPR。根本原因の推定
「Post new articles to dev.to」ステップが 1秒以内 で失敗し exit code 1 を返していることから、
DEV_TO_API_KEYシークレットが未設定(または空)である可能性が高い。DEV_TO_API_KEYが空の場合、Goツールは即座にlog.Fatal("--api-key is required")で終了するcontent/en/posts/*.mdが存在せず、投稿ステップがスキップされていた変更内容
1.
DEV_TO_API_KEY存在確認ステップ追加投稿ステップの前に明示的なチェックを入れ、未設定の場合は分かりやすいエラーメッセージを出力するようにした。
2.
workflow_dispatchトリガー追加手動実行を可能にした。投稿済み記事を再投稿したい場合や、ファイルを指定して単発実行したい場合に利用できる。
3. シェルインジェクション修正
for f in ${{ steps.detect.outputs.files }}の直接展開を、環境変数TARGET_FILES経由に変更した。4. 検出ファイルのログ出力追加
Detected files: ...をログに出力し、何が検出されたかを確認しやすくした。次のアクション(マニュアル対応が必要)
DEV_TO_API_KEYシークレットを確認・設定:Settings > Secrets and variables > Actions > DEV_TO_API_KEYに有効な dev.to API キーを設定してくださいcontent/en/posts/introducing-asset-trend-simulator.mdcontent/en/posts/introducing-bookstacks.mdcontent/en/posts/introducing-donelog.md