Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Mark dist folder as generated
dist/** linguist-generated=true
dist/** -diff -merge linguist-generated=true
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ That's it! The action will automatically use your current repository and commit
| `git-ref` | | current commit/tag | Git ref (branch/tag/commit SHA, auto-detected) |
| `path` | | | Path to tar archive or single file (required for `tar`/`file`) |
| `setup-commands` | | | Newline-separated setup commands to run after installation |
| `is-public` | | `false` | Whether the agent should be publicly accessible |
| `api-url` | | `https://api.runloop.ai` | Runloop API URL |
| `object-ttl-days` | | | Time-to-live for uploaded objects in days |

Expand Down
5 changes: 0 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ inputs:
description: 'Newline-separated setup commands to run after agent installation'
required: false

is-public:
description: 'Whether the agent should be publicly accessible'
required: false
default: 'false'

api-url:
description: 'Runloop API URL (defaults to production)'
required: false
Expand Down
21 changes: 14 additions & 7 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion examples/tar-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ jobs:
agent-version: 1.0.0
path: agent.tar.gz
object-ttl-days: 30
is-public: false

deploy-from-artifacts:
runs-on: ubuntu-latest
Expand Down
10 changes: 5 additions & 5 deletions src/agent-deployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async function deployGitAgent(
body: {
name: agentName,
version: inputs.agentVersion,
is_public: inputs.isPublic,
...(inputs.isPublic !== undefined && { is_public: inputs.isPublic }),
source: {
type: 'git',
git: {
Expand Down Expand Up @@ -134,7 +134,7 @@ async function deployTarAgent(
body: {
name: agentName,
version: inputs.agentVersion,
is_public: inputs.isPublic,
...(inputs.isPublic !== undefined && { is_public: inputs.isPublic }),
source: {
type: 'object',
object: {
Expand Down Expand Up @@ -177,7 +177,7 @@ async function deployFileAgent(
body: {
name: agentName,
version: inputs.agentVersion,
is_public: inputs.isPublic,
...(inputs.isPublic !== undefined && { is_public: inputs.isPublic }),
source: {
type: 'object',
object: {
Expand Down Expand Up @@ -223,7 +223,7 @@ async function deployNpmAgent(
body: {
name: agentName,
version: inputs.agentVersion,
is_public: inputs.isPublic,
...(inputs.isPublic !== undefined && { is_public: inputs.isPublic }),
source: {
type: 'npm',
npm: npmSource,
Expand Down Expand Up @@ -265,7 +265,7 @@ async function deployPipAgent(
body: {
name: agentName,
version: inputs.agentVersion,
is_public: inputs.isPublic,
...(inputs.isPublic !== undefined && { is_public: inputs.isPublic }),
source: {
type: 'pip',
pip: pipSource,
Expand Down
14 changes: 11 additions & 3 deletions src/validators.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as core from '@actions/core';
import * as github from '@actions/github';
import * as fs from 'fs';
import * as path from 'path';

Expand All @@ -15,7 +16,7 @@ export interface ActionInputs {
pipPackage?: string;
pipIndexUrl?: string;
setupCommands?: string[];
isPublic: boolean;
isPublic?: boolean;
apiUrl: string;
objectTtlDays?: number;
}
Expand All @@ -26,7 +27,6 @@ export function getInputs(): ActionInputs {
// Get all inputs
const sourceType = core.getInput('source-type', { required: true }) as SourceType;
const setupCommandsRaw = core.getInput('setup-commands');
const isPublicRaw = core.getInput('is-public') || 'false';
const objectTtlDaysRaw = core.getInput('object-ttl-days');

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

// Hidden: if called from runloopai/runloop, set is_public based on "public:" version prefix
const { owner, repo } = github.context.repo;
if (owner === 'runloopai' && repo === 'runloop') {
if (inputs.agentVersion.startsWith('public:')) {
inputs.agentVersion = inputs.agentVersion.slice('public:'.length);
inputs.isPublic = true;
}
}

return inputs;
}

Expand Down
Loading