@@ -12,9 +12,8 @@ import * as exec from '@actions/exec';
1212import * as io from '@actions/io' ;
1313import * as tc from '@actions/tool-cache' ;
1414
15- const POWERPOINT_PACKAGE_NAME = 'Microsoft_PowerPoint_16.102.25101829_Updater.pkg' ;
16- const INSTALLER_URL =
17- `https://officecdn.microsoft.com/pr/C1297A47-86C4-4C1F-97FA-950631F94777/MacAutoupdate/${ POWERPOINT_PACKAGE_NAME } ` ;
15+ const POWERPOINT_PACKAGE_NAME = 'Microsoft_PowerPoint_16.103.25113013_Updater.pkg' ;
16+ const DEFAULT_MAC_AUTOUPDATE_BASE_URL = 'https://officecdn.microsoft.com/pr/C1297A47-86C4-4C1F-97FA-950631F94777/MacAutoupdate' ;
1817
1918async function main ( ) {
2019 try {
@@ -36,22 +35,35 @@ async function run() {
3635
3736 core . info ( 'Setting up Microsoft PowerPoint for Mac' ) ;
3837
39- const installerPath = await downloadInstaller ( ) ;
38+ const installerSource = resolveInstallerSource ( ) ;
39+ const installerPath = await downloadInstaller ( installerSource ) ;
4040 const powerpointAppPath = await installPowerPoint ( installerPath ) ;
4141 await reportInstalledVersion ( powerpointAppPath ) ;
4242 await configurePowerPointPolicies ( ) ;
4343 await enableUiAutomation ( ) ;
4444 await dismissPowerPointFirstRunDialogs ( ) ;
4545}
4646
47- async function downloadInstaller ( ) {
47+ function resolveInstallerSource ( ) {
48+ const packageName = core . getInput ( 'package' , { trimWhitespace : true } ) ;
49+
50+ if ( ! packageName ) {
51+ core . debug ( 'Using default Microsoft PowerPoint installer package.' ) ;
52+ packageName = POWERPOINT_PACKAGE_NAME ;
53+ }
54+
55+ core . info ( `Microsoft PowerPoint installer package name: '${ packageName } '` ) ;
56+ return { url : `${ DEFAULT_MAC_AUTOUPDATE_BASE_URL } /${ packageName } ` , packageName : packageName } ;
57+ }
58+
59+ async function downloadInstaller ( installerSource ) {
4860 core . startGroup ( 'Download Installer' ) ;
4961 try {
5062 core . info ( `Downloading Microsoft PowerPoint installer package...` ) ;
5163 const tempDirectory = process . env [ 'RUNNER_TEMP' ] || os . tmpdir ( ) ;
52- const targetPath = path . join ( tempDirectory , crypto . randomUUID ( ) , POWERPOINT_PACKAGE_NAME ) ;
64+ const targetPath = path . join ( tempDirectory , crypto . randomUUID ( ) , installerSource . packageName ) ;
5365
54- const downloadedPath = await tc . downloadTool ( INSTALLER_URL , targetPath ) ;
66+ const downloadedPath = await tc . downloadTool ( installerSource . url , targetPath ) ;
5567 core . info ( 'Installer package downloaded successfully.' ) ;
5668
5769 return downloadedPath ;
0 commit comments