ci-validation-gates

Automate CI/CD validation gates for npm package releases.

Updated Nov 27, 2024
One-click install
npx skills add https://github.com/Izak90/Izak90.github.io --skill ci-validation-gates-izak90
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ci-validation-gates
Source: https://github.com/Izak90/Izak90.github.io/tree/main/isaac_treinos_ar_livre/.copilot/skills/ci-validation-gates
Command: npx skills add https://github.com/Izak90/Izak90.github.io --skill ci-validation-gates-izak90

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

CI/CD pipelines often fail when releases are published with invalid version formats, incorrect tokens, missing retry logic, or draft releases. This Skill consolidates defensive patterns to prevent outages by enforcing checks at every stage.

Core Features & Use Cases

  • Semver Validation Gate: ensure only valid semantic versions are published to npm, avoiding 4-part or malformed versions.
  • NPM Token Type Verification: requireAutomation tokens and reject user tokens with 2FA to ensure CI autonomy.
  • Retry Logic for Registry Propagation: implement multiple verification attempts after publish to guard against eventual consistency.
  • Draft Release Detection: trigger workflows only on release: published and validate via API before proceeding.
  • Build Script Protection: set SKIP_BUILD_BUMP before release builds to prevent unintended version mutations.

Quick Start

Integrate these checks into your CI workflow: semver validation, token type enforcement, and retry propagation before publishing.

Frequently Asked Questions about ci-validation-gates

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce valid semver versions in an npm publish CI pipeline?

To enforce valid semver in an npm publish pipeline, apply a validation gate to reject 4-part or malformed versions before publishing. This prevents invalid semantic versions from reaching the npm registry during automated releases.

Why does my npm publish workflow fail in CI when using a user token?

Npm publish workflows fail in CI when using user tokens because they trigger 2FA prompts. You must verify token types and require automation tokens to ensure CI autonomy and block user tokens with 2FA requirements.

How do I handle npm registry propagation delays in GitHub Actions?

To handle npm registry propagation delays in GitHub Actions, implement retry logic with multiple verification attempts after publishing. This guards against eventual consistency issues when confirming successful package releases.

How do I prevent GitHub Actions workflows from triggering on draft releases?

To prevent workflows from triggering on draft releases, configure pipelines to trigger only on release: published events and validate the release status via the GitHub API before proceeding with builds.

Can I prevent unintended version mutations during npm release builds?

Yes, you can prevent unintended version mutations during npm release builds by setting the SKIP_BUILD_BUMP environment variable. This build script protection ensures deterministic delivery by blocking unintended version bumps.

What are defensive CI/CD patterns for reliable npm package delivery?

Defensive CI/CD patterns for reliable npm package delivery include semver validation, token type verification, retry propagation, and draft release detection. These deterministic checks prevent faulty releases and outages.