Unverified Commit b2eb13ba authored by Francesco Renzi's avatar Francesco Renzi Committed by GitHub
Browse files

Update @actions/core to 1.10.0 (#962)

* Update @actions/core to 1.10.0

* Backport state-helper updates
parent 7884fcad
Loading
Loading
Loading
Loading
+2456 −442

File changed.

Preview size limit exceeded, changes collapsed.

+22 −3
Changes for package-lock.json: 22 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -5,9 +5,28 @@
  "requires": true,
  "dependencies": {
    "@actions/core": {
      "version": "1.2.6",
      "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz",
      "integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA=="
      "version": "1.10.0",
      "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
      "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
      "requires": {
        "@actions/http-client": "^2.0.1",
        "uuid": "^8.3.2"
      },
      "dependencies": {
        "@actions/http-client": {
          "version": "2.0.1",
          "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
          "integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
          "requires": {
            "tunnel": "^0.0.6"
          }
        },
        "uuid": {
          "version": "8.3.2",
          "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
          "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
        }
      }
    },
    "@actions/exec": {
      "version": "1.0.1",
+1 −1
Changes for package.json: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@
  },
  "homepage": "https://github.com/actions/checkout#readme",
  "dependencies": {
    "@actions/core": "^1.2.6",
    "@actions/core": "^1.10.0",
    "@actions/exec": "^1.0.1",
    "@actions/github": "^2.2.0",
    "@actions/io": "^1.0.1",
+11 −22
Changes for src/state-helper.ts: 11 added lines, 22 removed lines.
Original line number Diff line number Diff line
import * as coreCommand from '@actions/core/lib/command'
import * as core from '@actions/core'

/**
 * Indicates whether the POST action is running
 */
export const IsPost = !!process.env['STATE_isPost']
export const IsPost = !!core.getState('isPost')

/**
 * The repository path for the POST action. The value is empty during the MAIN action.
 */
export const RepositoryPath =
  (process.env['STATE_repositoryPath'] as string) || ''
export const RepositoryPath = core.getState('repositoryPath')

/**
 * The set-safe-directory for the POST action. The value is set if input: 'safe-directory' is set during the MAIN action.
 */
export const PostSetSafeDirectory =
  (process.env['STATE_setSafeDirectory'] as string) === 'true'
export const PostSetSafeDirectory = core.getState('setSafeDirectory') === 'true'

/**
 * The SSH key path for the POST action. The value is empty during the MAIN action.
 */
export const SshKeyPath = (process.env['STATE_sshKeyPath'] as string) || ''
export const SshKeyPath = core.getState('sshKeyPath')

/**
 * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
 */
export const SshKnownHostsPath =
  (process.env['STATE_sshKnownHostsPath'] as string) || ''
export const SshKnownHostsPath = core.getState('sshKnownHostsPath')

/**
 * Save the repository path so the POST action can retrieve the value.
 */
export function setRepositoryPath(repositoryPath: string) {
  coreCommand.issueCommand(
    'save-state',
    {name: 'repositoryPath'},
    repositoryPath
  )
  core.saveState('repositoryPath', repositoryPath)
}

/**
 * Save the SSH key path so the POST action can retrieve the value.
 */
export function setSshKeyPath(sshKeyPath: string) {
  coreCommand.issueCommand('save-state', {name: 'sshKeyPath'}, sshKeyPath)
  core.saveState('sshKeyPath', sshKeyPath)
}

/**
 * Save the SSH known hosts path so the POST action can retrieve the value.
 */
export function setSshKnownHostsPath(sshKnownHostsPath: string) {
  coreCommand.issueCommand(
    'save-state',
    {name: 'sshKnownHostsPath'},
    sshKnownHostsPath
  )
  core.saveState('sshKnownHostsPath', sshKnownHostsPath)
}

/**
 * Save the sef-safe-directory input so the POST action can retrieve the value.
 */
export function setSafeDirectory() {
  coreCommand.issueCommand('save-state', {name: 'setSafeDirectory'}, 'true')
  core.saveState('setSafeDirectory', 'true')
}

// Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
// This is necessary since we don't have a separate entry point.
if (!IsPost) {
  coreCommand.issueCommand('save-state', {name: 'isPost'}, 'true')
  core.saveState('isPost', 'true')
}