Skip to content

Commit db967cc

Browse files
authored
commiting
1 parent 0172d31 commit db967cc

3 files changed

Lines changed: 54 additions & 0 deletions

File tree

.github/my-cli-action/action.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: "Setup MyCLI"
2+
description: "Installs MyCLI and adds it to the PATH"
3+
author: "Your Name"
4+
5+
inputs:
6+
version:
7+
description: "The CLI version to install"
8+
required: false
9+
default: "latest"
10+
11+
runs:
12+
using: "node16"
13+
main: "index.js"

.github/my-cli-action/index.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const core = require('@actions/core');
2+
const { execSync } = require('child_process');
3+
4+
async function run() {
5+
try {
6+
const version = core.getInput('version') || 'latest';
7+
8+
console.log(`Installing MyCLI version: ${version}...`);
9+
10+
execSync(`curl -fsSL https://cli.example.com/install.sh | sh`, { stdio: 'inherit' });
11+
12+
console.log("MyCLI installed successfully.");
13+
} catch (error) {
14+
core.setFailed(`Installation failed: ${error.message}`);
15+
}
16+
}
17+
18+
run();

.github/workflows/test.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Test MyCLI Setup
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- feature/*
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- name: Install MyCLI
16+
uses: ./.github/actions/my-cli-action
17+
with:
18+
version: '1.2.3'
19+
20+
- name: Verify CLI Installation
21+
run: |
22+
echo "Checking MyCLI version..."
23+
mycli --version

0 commit comments

Comments
 (0)