Skip to content

Commit c867ad1

Browse files
authored
Remove is_public input (#8)
1 parent b8c9e3a commit c867ad1

8 files changed

Lines changed: 32 additions & 24 deletions

File tree

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Mark dist folder as generated
2-
dist/** linguist-generated=true
2+
dist/** -diff -merge linguist-generated=true

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ That's it! The action will automatically use your current repository and commit
4141
| `git-ref` | | current commit/tag | Git ref (branch/tag/commit SHA, auto-detected) |
4242
| `path` | | | Path to tar archive or single file (required for `tar`/`file`) |
4343
| `setup-commands` | | | Newline-separated setup commands to run after installation |
44-
| `is-public` | | `false` | Whether the agent should be publicly accessible |
4544
| `api-url` | | `https://api.runloop.ai` | Runloop API URL |
4645
| `object-ttl-days` | | | Time-to-live for uploaded objects in days |
4746

action.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@ inputs:
6161
description: 'Newline-separated setup commands to run after agent installation'
6262
required: false
6363

64-
is-public:
65-
description: 'Whether the agent should be publicly accessible'
66-
required: false
67-
default: 'false'
68-
6964
api-url:
7065
description: 'Runloop API URL (defaults to production)'
7166
required: false

dist/index.js

Lines changed: 14 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/tar-agent.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ jobs:
134134
agent-version: 1.0.0
135135
path: agent.tar.gz
136136
object-ttl-days: 30
137-
is-public: false
138137

139138
deploy-from-artifacts:
140139
runs-on: ubuntu-latest

src/agent-deployer.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ async function deployGitAgent(
9191
body: {
9292
name: agentName,
9393
version: inputs.agentVersion,
94-
is_public: inputs.isPublic,
94+
...(inputs.isPublic !== undefined && { is_public: inputs.isPublic }),
9595
source: {
9696
type: 'git',
9797
git: {
@@ -134,7 +134,7 @@ async function deployTarAgent(
134134
body: {
135135
name: agentName,
136136
version: inputs.agentVersion,
137-
is_public: inputs.isPublic,
137+
...(inputs.isPublic !== undefined && { is_public: inputs.isPublic }),
138138
source: {
139139
type: 'object',
140140
object: {
@@ -177,7 +177,7 @@ async function deployFileAgent(
177177
body: {
178178
name: agentName,
179179
version: inputs.agentVersion,
180-
is_public: inputs.isPublic,
180+
...(inputs.isPublic !== undefined && { is_public: inputs.isPublic }),
181181
source: {
182182
type: 'object',
183183
object: {
@@ -223,7 +223,7 @@ async function deployNpmAgent(
223223
body: {
224224
name: agentName,
225225
version: inputs.agentVersion,
226-
is_public: inputs.isPublic,
226+
...(inputs.isPublic !== undefined && { is_public: inputs.isPublic }),
227227
source: {
228228
type: 'npm',
229229
npm: npmSource,
@@ -265,7 +265,7 @@ async function deployPipAgent(
265265
body: {
266266
name: agentName,
267267
version: inputs.agentVersion,
268-
is_public: inputs.isPublic,
268+
...(inputs.isPublic !== undefined && { is_public: inputs.isPublic }),
269269
source: {
270270
type: 'pip',
271271
pip: pipSource,

src/validators.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as core from '@actions/core';
2+
import * as github from '@actions/github';
23
import * as fs from 'fs';
34
import * as path from 'path';
45

@@ -15,7 +16,7 @@ export interface ActionInputs {
1516
pipPackage?: string;
1617
pipIndexUrl?: string;
1718
setupCommands?: string[];
18-
isPublic: boolean;
19+
isPublic?: boolean;
1920
apiUrl: string;
2021
objectTtlDays?: number;
2122
}
@@ -26,7 +27,6 @@ export function getInputs(): ActionInputs {
2627
// Get all inputs
2728
const sourceType = core.getInput('source-type', { required: true }) as SourceType;
2829
const setupCommandsRaw = core.getInput('setup-commands');
29-
const isPublicRaw = core.getInput('is-public') || 'false';
3030
const objectTtlDaysRaw = core.getInput('object-ttl-days');
3131

3232
const inputs: ActionInputs = {
@@ -47,11 +47,19 @@ export function getInputs(): ActionInputs {
4747
.map(cmd => cmd.trim())
4848
.filter(cmd => cmd.length > 0)
4949
: undefined,
50-
isPublic: isPublicRaw === 'true',
5150
apiUrl: core.getInput('api-url') || 'https://api.runloop.ai',
5251
objectTtlDays: objectTtlDaysRaw ? parseInt(objectTtlDaysRaw, 10) : undefined,
5352
};
5453

54+
// Hidden: if called from runloopai/runloop, set is_public based on "public:" version prefix
55+
const { owner, repo } = github.context.repo;
56+
if (owner === 'runloopai' && repo === 'runloop') {
57+
if (inputs.agentVersion.startsWith('public:')) {
58+
inputs.agentVersion = inputs.agentVersion.slice('public:'.length);
59+
inputs.isPublic = true;
60+
}
61+
}
62+
5563
return inputs;
5664
}
5765

0 commit comments

Comments
 (0)