Repository navigation
versioning: リリース前のバージョン検証を追加 #140 - #141
Merged
Merged
Conversation
Co-authored-by: Claude <noreply@anthropic.com>
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.
Closes #140
変更内容
actions/versioningの処理をversioning.shに切り出し、次の検証を追加しました。prefixの除去後に、refs/tags/と先頭のvも常に除去します。v1.2.2形式のタグでも、呼び出し側で prefix を指定する必要はありません(anyway-feedback 1.2.2 のケース)。^[0-9]+(\.[0-9]+){1,3}$に一致しなければ失敗します(nightly、1.2.3-betaなど)。wporg_slugを指定したときだけ、api.wordpress.org/plugins/info/1.0/<slug>.jsonのversionより大きいことを確認します(ドラフトが巻き戻るケース)。API のエラーや未公開のときはスキップします。数字とドットのみなので、sort -Vの結果はversion_compareと一致します。grep $VERSIONによる存在確認をやめました。代わりに、すべてのVersion:/Stable Tag:行の値がバージョンと完全一致するか確認します。ヘッダーが1つもなければ失敗します。version(正規化後)を追加しました。run:に直接展開していたので、env 経由で渡すようにしました(スクリプトインジェクション対策)。互換性
filesのどれかが存在しないとき、これまでどおり書き換えをスキップして成功します(今回から警告を出します)。ただし、形式チェックと WordPress.org との比較はその前に実行されるようになりました。andstor/file-existence-actionへの依存をなくしました。テスト
tests/versioning/run.shを追加し、CI の versioning ジョブから実行するようにしました。ローカルでは 21 件すべて通過しています。WordPress.org API はfile://のフェイクに差し替えています。実際の API(anyway-feedback、現行 1.2.3)に対しても、1.2.2 で失敗することを確認しました。マージ後
wporg_slugを追加するかどうかは、別途判断してください。🤖 Generated with Claude Code