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

PMGR-9933 - allow overriding of the URL that contains the SFDX CLI so that if a regression is introduced into the CLI, we can easily roll back to an older version #1

Merged
merged 1 commit into from
Sep 9, 2021
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 action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ inputs:
sfdx-auth-url:
description: Authorize a Salesforce org using an SFDX auth URL
required: false
tarball-url:
description: Supply a URL to a XZip'd tarball containing the version of the SFDX CLI to install. If omitted or blank, it will install the "latest" CLI
required: false
runs:
using: 'node12'
main: 'index.js'
Expand Down
13 changes: 11 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,18 @@ try {
}

function installSFDX(){
var download = 'wget https://developer.salesforce.com/media/salesforce-cli/sfdx/channels/stable/sfdx-linux-x64.tar.xz -q -P /tmp'
var tarballBase = 'https://developer.salesforce.com/media/salesforce-cli/sfdx/channels/stable'
var tarballFile = 'sfdx-linux-x64.tar.xz'

var tarballOverride = core.getInput('tarball-url')
if(tarballOverride ){
tarballBase = tarballOverride.substr(0,tarballOverride.lastIndexOf('/'))
tarballFile = tarballOverride.substr(tarballOverride.lastIndexOf('/')+1)
}

var download = 'wget ' + tarballBase + '/' + tarballFile + ' -q -P /tmp'
var createDir = 'mkdir sfdx'
var unzip = 'tar xJf /tmp/sfdx-linux-x64.tar.xz -C sfdx --strip-components 1'
var unzip = 'tar xJf /tmp/' + tarballFile + ' -C sfdx --strip-components 1'
var install = 'echo "`pwd`/sfdx/bin" >> $GITHUB_PATH'
var version = 'sfdx/bin/sfdx --version && sfdx/bin/sfdx plugins --core'
exec(download+' && '+createDir+' && '+unzip+' && '+install+' && '+version, function(error, stdout, stderr){
Expand Down