-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
- Loading branch information
Showing
3 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -1,12 +1,26 @@ | ||
import * as core from '@actions/core'; | ||
|
||
import {BakeDefinition} from '@docker/actions-toolkit/lib/types/buildx/bake'; | ||
|
||
import {Inputs, sanitizeInputs} from './context'; | ||
|
||
export const tmpDir = process.env['STATE_tmpDir'] || ''; | ||
export const inputs = process.env['STATE_inputs'] ? JSON.parse(process.env['STATE_inputs']) : undefined; | ||
export const bakeDefinition = process.env['STATE_bakeDefinition'] ? <BakeDefinition>JSON.parse(process.env['STATE_bakeDefinition']) : undefined; | ||
export const buildRefs = process.env['STATE_buildRefs'] ? process.env['STATE_buildRefs'].split(',') : []; | ||
|
||
export function setTmpDir(tmpDir: string) { | ||
core.saveState('tmpDir', tmpDir); | ||
} | ||
|
||
export function setInputs(inputs: Inputs) { | ||
core.saveState('inputs', JSON.stringify(sanitizeInputs(inputs))); | ||
} | ||
|
||
export function setBakeDefinition(bakeDefinition: BakeDefinition) { | ||
core.saveState('bakeDefinition', JSON.stringify(bakeDefinition)); | ||
} | ||
|
||
export function setBuildRefs(buildRefs: Array<string>) { | ||
core.saveState('buildRefs', buildRefs.join(',')); | ||
} |