-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into pac-guerreiro/fix/51347-mobile-browser-camer…
…a-too-zoomed-in
- Loading branch information
Showing
498 changed files
with
744,030 additions
and
8,103 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
.github/actions/javascript/getAndroidRolloutPercentage/action.yml
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,15 @@ | ||
name: 'Get Android Rollout percentage' | ||
description: 'Gets the current Android track rollout percentage.' | ||
inputs: | ||
GOOGLE_KEY_FILE: | ||
description: Authentication file for Google Cloud API | ||
required: true | ||
PACKAGE_NAME: | ||
description: Package name to check the status of | ||
required: true | ||
outputs: | ||
CURRENT_ROLLOUT_PERCENTAGE: | ||
description: 'The current rollout percentage of the track' | ||
runs: | ||
using: 'node20' | ||
main: './index.js' |
43 changes: 43 additions & 0 deletions
43
.github/actions/javascript/getAndroidRolloutPercentage/getAndroidRolloutPercentage.ts
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 * as core from '@actions/core'; | ||
import {google} from 'googleapis'; | ||
|
||
const PACKAGE_NAME = core.getInput('PACKAGE_NAME', {required: true}); | ||
const GOOGLE_KEY_FILE = core.getInput('GOOGLE_KEY_FILE', {required: true}); | ||
|
||
async function getAndroidRolloutPercentage() { | ||
const auth = new google.auth.GoogleAuth({ | ||
keyFile: GOOGLE_KEY_FILE, | ||
scopes: ['https://www.googleapis.com/auth/androidpublisher'], | ||
}); | ||
|
||
const androidApi = google.androidpublisher({ | ||
version: 'v3', | ||
auth, | ||
}); | ||
|
||
try { | ||
// The Google Play API requires an edit ID to make changes to the app | ||
const editResponse = await androidApi.edits.insert({ | ||
packageName: PACKAGE_NAME, | ||
}); | ||
const editId = editResponse.data.id ?? 'undefined'; | ||
|
||
// Get the production track status | ||
const trackResponse = await androidApi.edits.tracks.get({ | ||
packageName: PACKAGE_NAME, | ||
editId, | ||
track: 'production', | ||
}); | ||
|
||
const userFraction = trackResponse.data.releases?.[0]?.userFraction ?? '-1'; | ||
console.log('Track response', JSON.stringify(trackResponse.data)); | ||
console.log('Current Android rollout percentage:', userFraction); | ||
|
||
core.setOutput('CURRENT_ROLLOUT_PERCENTAGE', userFraction); | ||
} catch (error) { | ||
console.error('Error checking track status:', error); | ||
process.exit(1); | ||
} | ||
} | ||
|
||
getAndroidRolloutPercentage().then(() => {}); |
Oops, something went wrong.