From 8e6a591b44b58d102d05c406729649c1564297c3 Mon Sep 17 00:00:00 2001 From: Sibiraj <20282546+sibiraj-s@users.noreply.github.com> Date: Sun, 29 Oct 2023 11:14:00 +0530 Subject: [PATCH] feat: add Prow CI --- README.md | 1 + index.d.ts | 1 + test.js | 16 ++++++++++++++++ vendors.json | 5 +++++ 4 files changed, 23 insertions(+) diff --git a/README.md b/README.md index ab5719f..90ce7f4 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ Officially supported CI servers: | [Magnum CI](https://magnum-ci.com) | `ci.MAGNUM` | 🚫 | | [Netlify CI](https://www.netlify.com/) | `ci.NETLIFY` | ✅ | | [Nevercode](http://nevercode.io/) | `ci.NEVERCODE` | ✅ | +| [Prow](https://docs.prow.k8s.io/) | `ci.PROW` | 🚫 | | [ReleaseHub](https://releasehub.com/) | `ci.RELEASEHUB` | 🚫 | | [Render](https://render.com/) | `ci.RENDER` | ✅ | | [Sail CI](https://sail.ci/) | `ci.SAIL` | ✅ | diff --git a/index.d.ts b/index.d.ts index d64b0a0..ad6120a 100644 --- a/index.d.ts +++ b/index.d.ts @@ -58,6 +58,7 @@ export const LAYERCI: boolean; export const MAGNUM: boolean; export const NETLIFY: boolean; export const NEVERCODE: boolean; +export const PROW: boolean; export const RELEASEHUB: boolean; export const RENDER: boolean; export const SAIL: boolean; diff --git a/test.js b/test.js index 243ce18..014d47e 100644 --- a/test.js +++ b/test.js @@ -972,6 +972,22 @@ test('Vela - PR', function (t) { t.end() }) +test('Prow', function (t) { + process.env.PROW_JOB_ID = '123' + + clearModule('./') + const ci = require('./') + + t.equal(ci.isCI, true) + t.equal(ci.name, 'Prow') + t.equal(ci.PROW, true) + assertVendorConstants('PROW', ci, t) + + delete process.env.PROW + + t.end() +}) + function assertVendorConstants (expect, ci, t) { ci._vendors.forEach(function (constant) { let bool = constant === expect diff --git a/vendors.json b/vendors.json index 8247395..5bea090 100644 --- a/vendors.json +++ b/vendors.json @@ -210,6 +210,11 @@ "ne": "false" } }, + { + "name": "Prow", + "constant": "PROW", + "env": "PROW_JOB_ID" + }, { "name": "ReleaseHub", "constant": "RELEASEHUB",