From f6f173fcc842f1a64b0d81b9c947632438eeca01 Mon Sep 17 00:00:00 2001 From: Sibiraj <20282546+sibiraj-s@users.noreply.github.com> Date: Sun, 29 Oct 2023 10:37:00 +0530 Subject: [PATCH] feat: support Gitea Actions --- 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 203d13e..3b68594 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ Officially supported CI servers: | [Gerrit CI](https://www.gerritcodereview.com) | `ci.GERRIT` | 🚫 | | [GitHub Actions](https://github.com/features/actions/) | `ci.GITHUB_ACTIONS` | ✅ | | [GitLab CI](https://about.gitlab.com/gitlab-ci/) | `ci.GITLAB` | ✅ | +| [Gitea Actions](https://about.gitea.com/) | `ci.GITEA_ACTIONS` | 🚫 | | [GoCD](https://www.go.cd/) | `ci.GOCD` | 🚫 | | [Google Cloud Build](https://cloud.google.com/build) | `ci.GOOGLE_CLOUD_BUILD` | 🚫 | | [Harness CI](https://www.harness.io/products/continuous-integration) | `ci.HARNESS` | 🚫 | diff --git a/index.d.ts b/index.d.ts index fcc32d5..3f30e79 100644 --- a/index.d.ts +++ b/index.d.ts @@ -44,6 +44,7 @@ export const DRONE: boolean; export const DSARI: boolean; export const EAS: boolean; export const GERRIT: boolean; +export const GITEA_ACTIONS: boolean; export const GITHUB_ACTIONS: boolean; export const GITLAB: boolean; export const GOCD: boolean; diff --git a/test.js b/test.js index c0fcd31..235369d 100644 --- a/test.js +++ b/test.js @@ -916,6 +916,22 @@ test('ReleaseHub', function (t) { t.end() }) +test('Gitea Actions', function (t) { + process.env.GITEA_ACTIONS = 'true' + + clearModule('./') + const ci = require('./') + + t.equal(ci.isCI, true) + t.equal(ci.name, 'Gitea Actions') + t.equal(ci.GITEA_ACTIONS, true) + assertVendorConstants('GITEA_ACTIONS', ci, t) + + delete process.env.GITEA_ACTIONS + + 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 831fe84..8603a5f 100644 --- a/vendors.json +++ b/vendors.json @@ -114,6 +114,11 @@ "constant": "GERRIT", "env": "GERRIT_PROJECT" }, + { + "name": "Gitea Actions", + "constant": "GITEA_ACTIONS", + "env": "GITEA_ACTIONS" + }, { "name": "GitHub Actions", "constant": "GITHUB_ACTIONS",