Skip to content

Commit 336a12d

Browse files
jontiritilliclaude
andcommitted
fix: accept domorig.io and domotech.io instances in validation
Go CLI accepts .domo.com, domorig.io, and domotech.io domains. Our validator was only checking .domo.com. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 9b8824a commit 336a12d

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

__tests__/index.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ describe('Domo Publish Action', () => {
100100
expect(core.setFailed).not.toHaveBeenCalled();
101101
});
102102

103+
test('accepts domorig.io instances', () => {
104+
expect(validateInputs('token-123', 'https://company.domorig.io')).toBe(true);
105+
});
106+
107+
test('accepts domotech.io instances', () => {
108+
expect(validateInputs('token-123', 'https://company.domotech.io')).toBe(true);
109+
});
110+
103111
test('accepts bare hostname without https prefix', () => {
104112
expect(validateInputs('token-123', 'company.domo.com')).toBe(true);
105113
});

dist/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44625,6 +44625,8 @@ const core = __nccwpck_require__(7484);
4462544625
* @param {string} domoToken - The Domo API token
4462644626
* @param {string} domoInstance - The Domo instance URL
4462744627
*/
44628+
const VALID_DOMO_DOMAINS = ['.domo.com', '.domorig.io', '.domotech.io'];
44629+
4462844630
function validateInputs(domoToken, domoInstance) {
4462944631
if (!domoToken) {
4463044632
core.setFailed('Domo token is required for authentication.');
@@ -44640,7 +44642,7 @@ function validateInputs(domoToken, domoInstance) {
4464044642
const url = new URL(
4464144643
domoInstance.startsWith('http') ? domoInstance : `https://${domoInstance}`
4464244644
);
44643-
if (!url.hostname.endsWith('.domo.com')) {
44645+
if (!VALID_DOMO_DOMAINS.some((d) => url.hostname.endsWith(d))) {
4464444646
core.setFailed('Invalid Domo instance URL. Must be a valid Domo instance.');
4464544647
return false;
4464644648
}

src/steps/validateInputs.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ const core = require('@actions/core');
55
* @param {string} domoToken - The Domo API token
66
* @param {string} domoInstance - The Domo instance URL
77
*/
8+
const VALID_DOMO_DOMAINS = ['.domo.com', '.domorig.io', '.domotech.io'];
9+
810
function validateInputs(domoToken, domoInstance) {
911
if (!domoToken) {
1012
core.setFailed('Domo token is required for authentication.');
@@ -20,7 +22,7 @@ function validateInputs(domoToken, domoInstance) {
2022
const url = new URL(
2123
domoInstance.startsWith('http') ? domoInstance : `https://${domoInstance}`
2224
);
23-
if (!url.hostname.endsWith('.domo.com')) {
25+
if (!VALID_DOMO_DOMAINS.some((d) => url.hostname.endsWith(d))) {
2426
core.setFailed('Invalid Domo instance URL. Must be a valid Domo instance.');
2527
return false;
2628
}

0 commit comments

Comments
 (0)