Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export commited editId for further modifications #233

Merged
merged 3 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ This action will help you upload an Android `.apk` or `.aab` (Android App Bundle
| --- | --- | --- |
| internalSharingDownloadUrls | INTERNAL_SHARING_DOWNLOAD_URLS | A JSON list containing the download urls for every release file uploaded using the `internalsharing` track |
| internalSharingDownloadUrl | INTERNAL_SHARING_DOWNLOAD_URL | The download url for the last release file uploaded using the `internalsharing` track |
committedEditId | COMMITTED_EDIT_ID | The unique identifier of the committed edit. |
committedEditIdExpiryTimeSeconds | COMMITTED_EDIT_ID_EXPIRY_TIME_SECONDS | Time in seconds until the committed edit expires. |


## Example usage

Expand Down
10 changes: 8 additions & 2 deletions src/edits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export async function runUpload(

async function uploadToPlayStore(options: EditOptions, releaseFiles: string[]): Promise<string | void> {
const internalSharingDownloadUrls: string[] = []

// Check the 'track' for 'internalsharing', if so switch to a non-track api
if (options.track === 'internalsharing') {
core.debug("Track is Internal app sharing, switch to special upload api")
Expand Down Expand Up @@ -115,6 +114,13 @@ async function uploadToPlayStore(options: EditOptions, releaseFiles: string[]):
// Simple check to see whether commit was successful
if (res.data.id) {
core.info(`Successfully committed ${res.data.id}`);

core.setOutput("committedEditId", res.data.id);
core.setOutput("commitedEditIdExpiryTimeSeconds", res.data.expiryTimeSeconds);

core.exportVariable("COMMITED_EDIT_ID", res.data.id);
core.exportVariable("COMMITED_EDIT_ID_EXPIRY_IN_TIME_SECONDS", res.data.expiryTimeSeconds);

return res.data.id
} else {
core.setFailed(`Error ${res.status}: ${res.statusText}`);
Expand Down Expand Up @@ -411,4 +417,4 @@ function inferInternalSharingDownloadUrl(
versionCode: number
) {
return `https://play.google.com/apps/test/${applicationId}/${versionCode}`;
}
}
Loading