Update @actions/core to 1.10.0 (#962)

* Update @actions/core to 1.10.0

* Backport state-helper updates
This commit is contained in:
Francesco Renzi 2022-10-13 16:49:13 +01:00 committed by GitHub
parent 7884fcad6b
commit b2eb13baee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 2507 additions and 485 deletions

2928
dist/index.js vendored

File diff suppressed because it is too large Load diff

25
package-lock.json generated
View file

@ -5,9 +5,28 @@
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"@actions/core": { "@actions/core": {
"version": "1.2.6", "version": "1.10.0",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz", "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
"integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA==" "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": { "@actions/exec": {
"version": "1.0.1", "version": "1.0.1",

View file

@ -28,7 +28,7 @@
}, },
"homepage": "https://github.com/actions/checkout#readme", "homepage": "https://github.com/actions/checkout#readme",
"dependencies": { "dependencies": {
"@actions/core": "^1.2.6", "@actions/core": "^1.10.0",
"@actions/exec": "^1.0.1", "@actions/exec": "^1.0.1",
"@actions/github": "^2.2.0", "@actions/github": "^2.2.0",
"@actions/io": "^1.0.1", "@actions/io": "^1.0.1",

View file

@ -1,71 +1,60 @@
import * as coreCommand from '@actions/core/lib/command' import * as core from '@actions/core'
/** /**
* Indicates whether the POST action is running * 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. * The repository path for the POST action. The value is empty during the MAIN action.
*/ */
export const RepositoryPath = export const RepositoryPath = core.getState('repositoryPath')
(process.env['STATE_repositoryPath'] as string) || ''
/** /**
* The set-safe-directory for the POST action. The value is set if input: 'safe-directory' is set during the MAIN action. * 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 = export const PostSetSafeDirectory = core.getState('setSafeDirectory') === 'true'
(process.env['STATE_setSafeDirectory'] as string) === 'true'
/** /**
* The SSH key path for the POST action. The value is empty during the MAIN action. * 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. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
*/ */
export const SshKnownHostsPath = export const SshKnownHostsPath = core.getState('sshKnownHostsPath')
(process.env['STATE_sshKnownHostsPath'] as string) || ''
/** /**
* Save the repository path so the POST action can retrieve the value. * Save the repository path so the POST action can retrieve the value.
*/ */
export function setRepositoryPath(repositoryPath: string) { export function setRepositoryPath(repositoryPath: string) {
coreCommand.issueCommand( core.saveState('repositoryPath', repositoryPath)
'save-state',
{name: 'repositoryPath'},
repositoryPath
)
} }
/** /**
* Save the SSH key path so the POST action can retrieve the value. * Save the SSH key path so the POST action can retrieve the value.
*/ */
export function setSshKeyPath(sshKeyPath: string) { 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. * Save the SSH known hosts path so the POST action can retrieve the value.
*/ */
export function setSshKnownHostsPath(sshKnownHostsPath: string) { export function setSshKnownHostsPath(sshKnownHostsPath: string) {
coreCommand.issueCommand( core.saveState('sshKnownHostsPath', sshKnownHostsPath)
'save-state',
{name: 'sshKnownHostsPath'},
sshKnownHostsPath
)
} }
/** /**
* Save the sef-safe-directory input so the POST action can retrieve the value. * Save the sef-safe-directory input so the POST action can retrieve the value.
*/ */
export function setSafeDirectory() { 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. // 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. // This is necessary since we don't have a separate entry point.
if (!IsPost) { if (!IsPost) {
coreCommand.issueCommand('save-state', {name: 'isPost'}, 'true') core.saveState('isPost', 'true')
} }