Skip to content

Commit

Permalink
Improve README content
Browse files Browse the repository at this point in the history
  • Loading branch information
yasassri committed Sep 23, 2022
1 parent bc10db4 commit 94063ae
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,41 @@ This action will Setup WSO2 API-CTL in a Lunux environment. Since there are no u

**Optional** The version of the APICTL to setup. Default `"4.1.0"`.

The version will be picked from the Github releases : https://github.com/wso2/product-apim-tooling/releases. Ex: 4.1.0
The version will be picked from the Github releases : https://github.com/wso2/product-apim-tooling/releases. Ex: 4.1.0 or v4.1.0

## `tarball_location`

**Optional** A location to an APICTL Tarball if it needs to be downloaded from custom location. No Default

## Example usage

```
```yaml
uses: yasassri/setup-wso2-apictl@v1.0
with:
version: '4.1.0'
```
```
```yaml
uses: yasassri/setup-wso2-apictl@v1.0
with:
tarball_location: 'https://github.com/wso2/product-apim-tooling/releases/download/v4.1.0/apictl-4.1.0-linux-x64.tar.gz'
```
```
### Full workflow
```yaml
name: WSO2_APIM
on: [push, pull_request_target, issues]

jobs:
wso2:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: yasassri/setup-wso2-apictl@v1.0
with:
version: 'v3.2.5'
- run: apictl version
```
4 changes: 0 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ async function setup() {
var version = core.getInput('version');
var url = core.getInput('tarball_location');


console.log("version:::: " +version)
console.log("URL:::: " +url)
// If a URL not set, generate the URL based on the version
if(url == null || url.trim() == '') {
url = getDownloadURL(version)
Expand Down Expand Up @@ -52,7 +49,6 @@ if (require.main === require.cache[eval('__filename')]) {
function getDownloadURL(version) {

// If the version is provided like v4.1.0 strippingout the 'v'
console.log("DEBUG:::: " + version.toLowerCase().includes("v"));
if(version.toLowerCase().includes("v")) {
version = version.substring(version.toLowerCase().indexOf('v') + 1);
}
Expand Down
3 changes: 0 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ async function setup() {
var version = core.getInput('version');
var url = core.getInput('tarball_location');


console.log("version:::: " +version)
console.log("URL:::: " +url)
// If a URL not set, generate the URL based on the version
if(url == null || url.trim() == '') {
url = getDownloadURL(version)
Expand Down
1 change: 0 additions & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
function getDownloadURL(version) {

// If the version is provided like v4.1.0 strippingout the 'v'
console.log("DEBUG:::: " + version.toLowerCase().includes("v"));
if(version.toLowerCase().includes("v")) {
version = version.substring(version.toLowerCase().indexOf('v') + 1);
}
Expand Down

0 comments on commit 94063ae

Please sign in to comment.