generated from actions/typescript-action
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add validator * feat: add validator * feat: minor improvemnets * feat: dist created * feat: minor changes * feat: minor changes * feat: minor changes * feat: minor changes * feat: add get detail functionality * feat: add js files * feat: add js files * feat: add js files
- Loading branch information
1 parent
62b2c78
commit d817e03
Showing
5 changed files
with
132 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { ActionType, BaseProps } from 'src/constants' | ||
import { IValidator } from './IValidator' | ||
import * as core from '@actions/core' | ||
import { validateStringParameter } from 'src/utils' | ||
|
||
export interface GetAppDetailProps extends BaseProps { | ||
packageName: string | ||
} | ||
|
||
export class GetAppDetail extends IValidator<GetAppDetailProps> { | ||
public type: ActionType = ActionType.GET_APP_DETAILS | ||
|
||
public validateVariables(): GetAppDetailProps { | ||
const data = super.validateVariables() | ||
const packageName: string = core.getInput('packageName') | ||
|
||
validateStringParameter('packageName', packageName); | ||
|
||
return { | ||
...data, | ||
packageName, | ||
} | ||
} | ||
|
||
public async createAntHitRequest(props: GetAppDetailProps) { | ||
const headers = { | ||
Authorization: `Bearer ${props.apiKey}` | ||
} | ||
|
||
|
||
const axios = require('axios') | ||
|
||
const response = await axios.get( | ||
`https://developer-api.indusappstore.com/apis/indus-developerdashboard-service/devtools/app/details/${props.packageName}`, | ||
{ headers } | ||
) | ||
console.log(response.statusText) | ||
console.log(response.status) | ||
console.log(response.data) | ||
core.debug(response.data) | ||
core.setOutput("result", response.data) | ||
} | ||
} |