File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree File renamed without changes.
Original file line number Diff line number Diff line change 1+ name : " Setup MyCLI"
2+ description : " Installs MyCLI and adds it to the PATH"
3+ author : " Christianncode"
4+
5+ inputs :
6+ version :
7+ description : " The CLI version to install"
8+ required : false
9+ default : " latest"
10+ runs :
11+ using : " node16"
12+ main : " index.js"
Original file line number Diff line number Diff line change 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` , {
11+ stdio : "inherit" ,
12+ } ) ;
13+
14+ console . log ( "MyCLI installed successfully." ) ;
15+ } catch ( error ) {
16+ core . setFailed ( `Installation failed: ${ error . message } ` ) ;
17+ }
18+ }
19+
20+ run ( ) ;
Original file line number Diff line number Diff line change 1+ name : Test MyCLI Setup
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ - feature/*
8+
9+ jobs :
10+ test :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - name : Checkout repository
14+ uses : actions/checkout@v4
15+
16+ - name : Install MyCLI
17+ uses : ./.github/actions/my-cli-action
18+ with :
19+ version : " 1.2.3"
20+
21+ - name : Verify CLI Installation
22+ run : |
23+ echo "Checking MyCLI version..."
24+ mycli --version
Original file line number Diff line number Diff line change 1515 uses : actions/checkout@v4
1616
1717 - name : Call Greeting Workflow
18- uses : ./.github/workflows/utilities /composite-workflow
18+ uses : ./.github/actions /composite-workflow
1919 with :
2020 name : " Environment: ${{ vars.ENVIRONMENT_NAME }}"
2121 message : " Hola"
You can’t perform that action at this time.
0 commit comments