Skip to content

Commit

Permalink
feat: add support for sorucehut
Browse files Browse the repository at this point in the history
  • Loading branch information
sibiraj-s committed Nov 24, 2022
1 parent 199a0cb commit 85b96ea
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Officially supported CI servers:
| [Semaphore](https://semaphoreci.com) | `ci.SEMAPHORE` ||
| [Shippable](https://www.shippable.com/) | `ci.SHIPPABLE` ||
| [Solano CI](https://www.solanolabs.com/) | `ci.SOLANO` ||
| [Sourcehut](https://sourcehut.org/) | `ci.SOURCEHUT` | 🚫 |
| [Strider CD](https://strider-cd.github.io/) | `ci.STRIDER` | 🚫 |
| [TaskCluster](http://docs.taskcluster.net) | `ci.TASKCLUSTER` | 🚫 |
| [TeamCity](https://www.jetbrains.com/teamcity/) by JetBrains | `ci.TEAMCITY` | 🚫 |
Expand Down
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const SCREWDRIVER: boolean;
export const SEMAPHORE: boolean;
export const SHIPPABLE: boolean;
export const SOLANO: boolean;
export const SOURCEHUT: boolean;
export const STRIDER: boolean;
export const TASKCLUSTER: boolean;
export const TEAMCITY: boolean;
Expand Down
16 changes: 16 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,22 @@ test('Heroku', function (t) {
t.end()
})

test('Sourcehit', function (t) {
process.env.CI_NAME = 'sourcehut'

clearModule('./')
const ci = require('./')

t.equal(ci.isCI, true)
t.equal(ci.name, 'Sourcehut')
t.equal(ci.SOURCEHUT, true)
assertVendorConstants('SOURCEHUT', ci, t)

delete process.env.CI_NAME

t.end()
})

function assertVendorConstants (expect, ci, t) {
ci._vendors.forEach(function (constant) {
let bool = constant === expect
Expand Down
5 changes: 5 additions & 0 deletions vendors.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@
"env": "TDDIUM",
"pr": "TDDIUM_PR_ID"
},
{
"name": "Sourcehut",
"constant": "SOURCEHUT",
"env": { "CI_NAME": "sourcehut" }
},
{
"name": "Strider CD",
"constant": "STRIDER",
Expand Down

0 comments on commit 85b96ea

Please sign in to comment.