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 Get app versions * feat: add Get app versions * feat: minor improvements
- Loading branch information
1 parent
4c3ada9
commit 618ee19
Showing
8 changed files
with
127 additions
and
140 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,41 @@ | ||
import { ActionType, BaseProps } from 'src/constants' | ||
import { IValidator } from './IValidator' | ||
import * as core from '@actions/core' | ||
import { validateStringParameter } from 'src/utils' | ||
import { GetAppDetailProps } from './getAppDetail' | ||
|
||
|
||
export class GetAppVersions extends IValidator<GetAppDetailProps> { | ||
public type: ActionType = ActionType.GET_APP_VERSIONS | ||
|
||
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/versions/${props.packageName}`, | ||
{ headers } | ||
) | ||
console.log(response.statusText) | ||
console.log(response.status) | ||
console.log(response.data) | ||
core.debug(response.data) | ||
core.setOutput("result", response.data) | ||
} | ||
} |