Skip to content

Commit 7b14d95

Browse files
committed
update README with agent-version
1 parent 30f9a38 commit 7b14d95

3 files changed

Lines changed: 14 additions & 11 deletions

File tree

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ A GitHub Action to deploy agents to the [Runloop](https://runloop.ai) platform.
1414

1515
## Quick Start
1616

17-
### Deploy Current Repository as Agent
17+
### Deploy Current Repository as an Agent
1818

1919
```yaml
2020
- name: Deploy agent
2121
uses: runloopai/deploy-agent@main
2222
with:
2323
api-key: ${{ secrets.RUNLOOP_API_KEY }}
2424
source-type: git
25+
agent-version: 1.0.0
2526
```
2627
2728
That's it! The action will automatically use your current repository and commit SHA.
@@ -34,6 +35,7 @@ That's it! The action will automatically use your current repository and commit
3435
|-------|----------|---------|-------------|
3536
| `api-key` | ✅ | | Runloop API key (store in secrets) |
3637
| `source-type` | ✅ | | Agent source type: `git`, `tar`, or `file` |
38+
| `agent-version` | ✅ | | Agent version (semver string like `2.0.65` or git SHA) |
3739
| `agent-name` | | repo name | Name for the agent (defaults to repository name) |
3840
| `git-repository` | | current repo | Git repository URL (auto-detected) |
3941
| `git-ref` | | current commit/tag | Git ref (branch/tag/commit SHA, auto-detected) |
@@ -63,6 +65,7 @@ That's it! The action will automatically use your current repository and commit
6365
with:
6466
api-key: ${{ secrets.RUNLOOP_API_KEY }}
6567
source-type: git
68+
agent-version: 1.0.0
6669
setup-commands: |
6770
chmod +x scripts/agent.sh
6871
npm install
@@ -84,6 +87,7 @@ jobs:
8487
with:
8588
api-key: ${{ secrets.RUNLOOP_API_KEY }}
8689
source-type: git
90+
agent-version: ${{ github.event.release.tag_name }}
8791
agent-name: my-agent-${{ github.event.release.tag_name }}
8892
```
8993

@@ -105,6 +109,7 @@ Basic example:
105109
with:
106110
api-key: ${{ secrets.RUNLOOP_API_KEY }}
107111
source-type: tar
112+
agent-version: 1.0.0
108113
path: agent.tar.gz
109114
object-ttl-days: 30
110115
```
@@ -123,6 +128,7 @@ You can also use `.tar` format or reference output from a previous step:
123128
with:
124129
api-key: ${{ secrets.RUNLOOP_API_KEY }}
125130
source-type: tar
131+
agent-version: 1.0.0
126132
path: ${{ steps.build.outputs.archive-path }}
127133
```
128134

@@ -133,6 +139,7 @@ You can also use `.tar` format or reference output from a previous step:
133139
with:
134140
api-key: ${{ secrets.RUNLOOP_API_KEY }}
135141
source-type: file
142+
agent-version: 1.0.0
136143
path: ./scripts/agent.sh
137144
```
138145

action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ inputs:
5656
object-ttl-days:
5757
description: 'Time-to-live for uploaded objects in days (optional)'
5858
required: false
59+
# default is 'undefined' => don't auto-delete
5960

6061
outputs:
6162
agent-id:

src/validators.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,11 @@ export function validateInputs(inputs: ActionInputs): void {
9595
}
9696

9797
function validatePath(inputPath: string, sourceType: SourceType): void {
98-
// Resolve path relative to workspace
99-
const workspace = process.env.GITHUB_WORKSPACE;
100-
if (!workspace) {
101-
throw new Error('GITHUB_WORKSPACE environment variable is not set');
98+
if (sourceType !== 'file' && sourceType !== 'tar') {
99+
throw new Error(`validatePath is undefined when source-type is "${sourceType}": ${inputPath}`);
102100
}
103101

104-
const absolutePath = path.isAbsolute(inputPath) ? inputPath : path.join(workspace, inputPath);
102+
const absolutePath = resolvePath(inputPath);
105103

106104
// Check if path exists
107105
if (!fs.existsSync(absolutePath)) {
@@ -110,11 +108,8 @@ function validatePath(inputPath: string, sourceType: SourceType): void {
110108

111109
// Validate based on source type
112110
const stats = fs.statSync(absolutePath);
113-
114-
if (sourceType === 'file' || sourceType === 'tar') {
115-
if (!stats.isFile()) {
116-
throw new Error(`Path must be a file when source-type is "${sourceType}": ${inputPath}`);
117-
}
111+
if (!stats.isFile()) {
112+
throw new Error(`Path must be a file when source-type is "${sourceType}": ${inputPath}`);
118113
}
119114
}
120115

0 commit comments

Comments
 (0)