Merge pull request #429 from crazy-max/fix-keep-state

fix keep-state not being respected
This commit is contained in:
CrazyMax authored and GitHub committed 2025-06-18 10:37:30 +02:00
commit e468171a9d
4 files changed
+6 -5

No files matched your search

+1
View File
@@ -621,6 +621,7 @@ jobs:
uses: ./
with:
name: foo
keep-state: true
keep-state-error:
runs-on: ubuntu-latest
Generated Vendored
+1 -1
View File
@@ -103,5 +103,5 @@ const a=i(57147);const A=i(22037);const c=i(71017);const l=i(6113);const d={fs:a
* @license [MIT]{@link https://github.com/archiverjs/node-zip-stream/blob/master/LICENSE}
* @copyright (c) 2014 Chris Talkington, contributors.
*/
var a=i(73837).inherits;var A=i(25445).ZipArchiveOutputStream;var c=i(25445).ZipArchiveEntry;var l=i(82072);var d=r.exports=function(r){if(!(this instanceof d)){return new d(r)}r=this.options=r||{};r.zlib=r.zlib||{};A.call(this,r);if(typeof r.level==="number"&&r.level>=0){r.zlib.level=r.level;delete r.level}if(!r.forceZip64&&typeof r.zlib.level==="number"&&r.zlib.level===0){r.store=true}r.namePrependSlash=r.namePrependSlash||false;if(r.comment&&r.comment.length>0){this.setComment(r.comment)}};a(d,A);d.prototype._normalizeFileData=function(r){r=l.defaults(r,{type:"file",name:null,namePrependSlash:this.options.namePrependSlash,linkname:null,date:null,mode:null,store:this.options.store,comment:""});var s=r.type==="directory";var i=r.type==="symlink";if(r.name){r.name=l.sanitizePath(r.name);if(!i&&r.name.slice(-1)==="/"){s=true;r.type="directory"}else if(s){r.name+="/"}}if(s||i){r.store=true}r.date=l.dateify(r.date);return r};d.prototype.entry=function(r,s,i){if(typeof i!=="function"){i=this._emitErrorCallback.bind(this)}s=this._normalizeFileData(s);if(s.type!=="file"&&s.type!=="directory"&&s.type!=="symlink"){i(new Error(s.type+" entries not currently supported"));return}if(typeof s.name!=="string"||s.name.length===0){i(new Error("entry name must be a non-empty string value"));return}if(s.type==="symlink"&&typeof s.linkname!=="string"){i(new Error("entry linkname must be a non-empty string value when type equals symlink"));return}var a=new c(s.name);a.setTime(s.date,this.options.forceLocalTime);if(s.namePrependSlash){a.setName(s.name,true)}if(s.store){a.setMethod(0)}if(s.comment.length>0){a.setComment(s.comment)}if(s.type==="symlink"&&typeof s.mode!=="number"){s.mode=40960}if(typeof s.mode==="number"){if(s.type==="symlink"){s.mode|=40960}a.setUnixMode(s.mode)}if(s.type==="symlink"&&typeof s.linkname==="string"){r=Buffer.from(s.linkname)}return A.prototype.entry.call(this,a,r,i)};d.prototype.finalize=function(){this.finish()}},98954:function(r,s,i){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,s,i,a){if(a===undefined)a=i;var A=Object.getOwnPropertyDescriptor(s,i);if(!A||("get"in A?!s.__esModule:A.writable||A.configurable)){A={enumerable:true,get:function(){return s[i]}}}Object.defineProperty(r,a,A)}:function(r,s,i,a){if(a===undefined)a=i;r[a]=s[i]});var A=this&&this.__setModuleDefault||(Object.create?function(r,s){Object.defineProperty(r,"default",{enumerable:true,value:s})}:function(r,s){r["default"]=s});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var s={};if(r!=null)for(var i in r)if(i!=="default"&&Object.prototype.hasOwnProperty.call(r,i))a(s,r,i);A(s,r);return s};var l=this&&this.__awaiter||function(r,s,i,a){function adopt(r){return r instanceof i?r:new i((function(s){s(r)}))}return new(i||(i=Promise))((function(i,A){function fulfilled(r){try{step(a.next(r))}catch(r){A(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){A(r)}}function step(r){r.done?i(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,s||[])).next())}))};Object.defineProperty(s,"__esModule",{value:true});s.getVersion=s.getInspectArgs=s.getAppendArgs=s.getCreateArgs=s.getBuilderName=s.getInputs=s.builderNodeEnvPrefix=void 0;const d=c(i(6113));const u=c(i(42186));const p=i(50976);const g=i(28662);s.builderNodeEnvPrefix="BUILDER_NODE";const h="--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host";function getInputs(){return l(this,void 0,void 0,(function*(){return{version:u.getInput("version"),name:yield getBuilderName(u.getInput("name"),u.getInput("driver")||"docker-container"),driver:u.getInput("driver")||"docker-container",driverOpts:g.Util.getInputList("driver-opts",{ignoreComma:true,quote:false}),buildkitdFlags:u.getInput("buildkitd-flags"),platforms:g.Util.getInputList("platforms"),install:u.getBooleanInput("install"),use:u.getBooleanInput("use"),endpoint:u.getInput("endpoint"),buildkitdConfig:u.getInput("buildkitd-config")||u.getInput("config"),buildkitdConfigInline:u.getInput("buildkitd-config-inline")||u.getInput("config-inline"),append:u.getInput("append"),keepState:u.getBooleanInput("keep-state"),cacheBinary:u.getBooleanInput("cache-binary"),cleanup:u.getBooleanInput("cleanup")}}))}s.getInputs=getInputs;function getBuilderName(r,s){return l(this,void 0,void 0,(function*(){return s=="docker"?yield p.Docker.context():r||`builder-${d.randomUUID()}`}))}s.getBuilderName=getBuilderName;function getCreateArgs(r,s){return l(this,void 0,void 0,(function*(){const i=["create","--name",r.name,"--driver",r.driver];if(yield s.buildx.versionSatisfies(">=0.3.0")){yield g.Util.asyncForEach(r.driverOpts,(r=>l(this,void 0,void 0,(function*(){i.push("--driver-opt",r)}))));if(r.buildkitdFlags){i.push("--buildkitd-flags",r.buildkitdFlags)}else if(driverSupportsBuildkitdFlags(r.driver)){i.push("--buildkitd-flags",h)}}if(r.platforms.length>0){i.push("--platform",r.platforms.join(","))}if(r.use){i.push("--use")}if(r.buildkitdConfig){i.push("--conLine truncated
var a=i(73837).inherits;var A=i(25445).ZipArchiveOutputStream;var c=i(25445).ZipArchiveEntry;var l=i(82072);var d=r.exports=function(r){if(!(this instanceof d)){return new d(r)}r=this.options=r||{};r.zlib=r.zlib||{};A.call(this,r);if(typeof r.level==="number"&&r.level>=0){r.zlib.level=r.level;delete r.level}if(!r.forceZip64&&typeof r.zlib.level==="number"&&r.zlib.level===0){r.store=true}r.namePrependSlash=r.namePrependSlash||false;if(r.comment&&r.comment.length>0){this.setComment(r.comment)}};a(d,A);d.prototype._normalizeFileData=function(r){r=l.defaults(r,{type:"file",name:null,namePrependSlash:this.options.namePrependSlash,linkname:null,date:null,mode:null,store:this.options.store,comment:""});var s=r.type==="directory";var i=r.type==="symlink";if(r.name){r.name=l.sanitizePath(r.name);if(!i&&r.name.slice(-1)==="/"){s=true;r.type="directory"}else if(s){r.name+="/"}}if(s||i){r.store=true}r.date=l.dateify(r.date);return r};d.prototype.entry=function(r,s,i){if(typeof i!=="function"){i=this._emitErrorCallback.bind(this)}s=this._normalizeFileData(s);if(s.type!=="file"&&s.type!=="directory"&&s.type!=="symlink"){i(new Error(s.type+" entries not currently supported"));return}if(typeof s.name!=="string"||s.name.length===0){i(new Error("entry name must be a non-empty string value"));return}if(s.type==="symlink"&&typeof s.linkname!=="string"){i(new Error("entry linkname must be a non-empty string value when type equals symlink"));return}var a=new c(s.name);a.setTime(s.date,this.options.forceLocalTime);if(s.namePrependSlash){a.setName(s.name,true)}if(s.store){a.setMethod(0)}if(s.comment.length>0){a.setComment(s.comment)}if(s.type==="symlink"&&typeof s.mode!=="number"){s.mode=40960}if(typeof s.mode==="number"){if(s.type==="symlink"){s.mode|=40960}a.setUnixMode(s.mode)}if(s.type==="symlink"&&typeof s.linkname==="string"){r=Buffer.from(s.linkname)}return A.prototype.entry.call(this,a,r,i)};d.prototype.finalize=function(){this.finish()}},98954:function(r,s,i){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,s,i,a){if(a===undefined)a=i;var A=Object.getOwnPropertyDescriptor(s,i);if(!A||("get"in A?!s.__esModule:A.writable||A.configurable)){A={enumerable:true,get:function(){return s[i]}}}Object.defineProperty(r,a,A)}:function(r,s,i,a){if(a===undefined)a=i;r[a]=s[i]});var A=this&&this.__setModuleDefault||(Object.create?function(r,s){Object.defineProperty(r,"default",{enumerable:true,value:s})}:function(r,s){r["default"]=s});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var s={};if(r!=null)for(var i in r)if(i!=="default"&&Object.prototype.hasOwnProperty.call(r,i))a(s,r,i);A(s,r);return s};var l=this&&this.__awaiter||function(r,s,i,a){function adopt(r){return r instanceof i?r:new i((function(s){s(r)}))}return new(i||(i=Promise))((function(i,A){function fulfilled(r){try{step(a.next(r))}catch(r){A(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){A(r)}}function step(r){r.done?i(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,s||[])).next())}))};Object.defineProperty(s,"__esModule",{value:true});s.getVersion=s.getInspectArgs=s.getAppendArgs=s.getCreateArgs=s.getBuilderName=s.getInputs=s.builderNodeEnvPrefix=void 0;const d=c(i(6113));const u=c(i(42186));const p=i(50976);const g=i(28662);s.builderNodeEnvPrefix="BUILDER_NODE";const h="--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host";function getInputs(){return l(this,void 0,void 0,(function*(){return{version:u.getInput("version"),name:yield getBuilderName(u.getInput("name"),u.getInput("driver")||"docker-container"),driver:u.getInput("driver")||"docker-container",driverOpts:g.Util.getInputList("driver-opts",{ignoreComma:true,quote:false}),buildkitdFlags:u.getInput("buildkitd-flags"),platforms:g.Util.getInputList("platforms"),install:u.getBooleanInput("install"),use:u.getBooleanInput("use"),endpoint:u.getInput("endpoint"),buildkitdConfig:u.getInput("buildkitd-config")||u.getInput("config"),buildkitdConfigInline:u.getInput("buildkitd-config-inline")||u.getInput("config-inline"),append:u.getInput("append"),keepState:u.getBooleanInput("keep-state"),cacheBinary:u.getBooleanInput("cache-binary"),cleanup:u.getBooleanInput("cleanup")}}))}s.getInputs=getInputs;function getBuilderName(r,s){return l(this,void 0,void 0,(function*(){return s=="docker"?yield p.Docker.context():r||`builder-${d.randomUUID()}`}))}s.getBuilderName=getBuilderName;function getCreateArgs(r,s){return l(this,void 0,void 0,(function*(){const i=["create","--name",r.name,"--driver",r.driver];if(yield s.buildx.versionSatisfies(">=0.3.0")){yield g.Util.asyncForEach(r.driverOpts,(r=>l(this,void 0,void 0,(function*(){i.push("--driver-opt",r)}))));if(r.buildkitdFlags){i.push("--buildkitd-flags",r.buildkitdFlags)}else if(driverSupportsBuildkitdFlags(r.driver)){i.push("--buildkitd-flags",h)}}if(r.platforms.length>0){i.push("--platform",r.platforms.join(","))}if(r.use){i.push("--use")}if(r.buildkitdConfig){i.push("--conLine truncated
//# sourceMappingURL=index.js.map
Generated Vendored
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"index.js","names":["__createBinding","this","Object","create","o","m","k","k2","undefined","desc","getOwnPropertyDescriptor","__esModule","writable","configurable","enumerable","get","defineProperty","__exportStar","exports","p","prototype","hasOwnProperty","call","value","client_1","__webpack_require__","client","DefaultArtifactClient","Timestamp","runtime_1","runtime_2","runtime_3","runtime_4","runtime_5","runtime_6","runtime_7","Timestamp$Type","MessageType","constructor","super","no","name","kind","T","now","msg","ms","Date","seconds","PbLong","from","Math","floor","toString","nanos","toDate","message","toNumber","ceil","fromDate","date","getTime","internalJsonWrite","options","parse","Error","z","nanosStr","substring","toISOString","replace","internalJsonRead","json","target","typeofJsonValue","matches","match","Number","isNaN","globalThis","parseInt","repeat","length","MESSAGE_TYPE","reflectionMergePartial","internalBinaryRead","reader","end","pos","fieldNo","wireType","tag","int64","int32","u","readUnknownField","typeName","d","skip","UnknownFieldHandler","onRead","internalBinaryWrite","writer","WireType","Varint","writeUnknownFields","onWrite","BytesValue","StringValue","BoolValue","UInt32Value","Int32Value","UInt64Value","Int64Value","FloatValue","DoubleValue","DoubleValue$Type","refJsonWriter","scalar","refJsonReader","double","Bit64","FloatValue$Type","float","Bit32","Int64Value$Type","ScalarType","INT64","LongType","STRING","UInt64Value$Type","UINT64","uint64","Int32Value$Type","UInt32Value$Type","uint32","BoolValue$Type","bool","StringValue$Type","string","LengthDelimited","BytesValue$Type","Uint8Array","bytes","ArtifactService","DeleteArtifactResponse","DeleteArtifactRequest","GetSignedArtifactURLResponse","GetSignedArtifactURLRequest","ListArtifactsResponse_MonolithArtifact","ListArtifactsResponse","ListArtifactsRequest","FinalizeArtifactResponse","FinalizeArtifactRequest","CreateArtifactResponse","CreateArtifactRequest","FinalizeMigratedArtifactResponse","FinalizeMigratedArtifactRequest","MigrateArtifactResponse","MigrateArtifactRequest","runtime_rpc_1","wrappers_1","wrappers_2","timestamp_1","MigrateArtifactRequest$Type","workflowRunBackendId","expiresAt","fork","join","MigrateArtifactResponse$Type","ok","signedUploadUrl","FinalizeMigratedArtifactRequest$Type","size","FinalizeMigratedArtifactResponse$Type","artifactId","CreateArtifactRequest$Type","workflowJobRunBackendId","version","CreateArtifactResponse$Type","FinalizeArtifactRequest$Type","hash","FinalizeArtifactResponse$Type","ListArtifactsRequest$Type","nameFilter","idFilter","ListArtifactsResponse$Type","artifacts","push","i","ListArtifactsResponse_MonolithArtifact$Type","databaseId","createdAt","digest","GetSignedArtifactURLRequest$Type","GetSignedArtifactURLResponse$Type","signedUrl","DeleteArtifactRequest$Type","DeleteArtifactResponse$Type","ServiceType","I","O","ArtifactServiceClientProtobuf","ArtifactServiceClientJSON","artifact_1","rpc","CreateArtifact","bind","FinalizeArtifact","ListArtifacts","GetSignedArtifactURL","DeleteArtifact","request","data","toJson","useProtoFieldName","emitDefaultValues","promise","then","fromJson","ignoreUnknownFields","toBinary","fromBinary","__awaiter","thisArg","_arguments","P","generator","adopt","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","apply","__rest","s","t","indexOf","getOwnPropertySymbols","propertyIsEnumerable","core_1","config_1","upload_artifact_1","download_artifact_1","delete_artifact_1","get_artifact_1","list_artifacts_1","errors_1","uploadArtifact","files","rootDirectory","isGhes","GHESNotSupportedError","error","warning","downloadArtifact","findBy","repositoryOwner","repositoryName","token","downloadOptions","downloadArtifactPublic","downloadArtifactInternal","listArtifacts","workflowRunId","listArtifactsPublic","latest","listArtifactsInternal","getArtifact","artifactName","getArtifactPublic","getArtifactInternal","deleteArtifact","deleteArtifactPublic","deleteArtifactInternal","github_1","user_agent_1","retry_options_1","utils_1","plugin_request_log_1","plugin_retry_1","artifact_twirp_client_1","util_1","generated_1","_a","retryOpts","requestOpts","getRetryOptions","defaults","opts","log","userAgent","getUserAgentString","previews","retry","github","getOctokit","requestLog","getArtifactResp","deleteArtifactResp","rest","actions","owner","repo","artifact_id","artifact","id","status","InvalidResponseError","headers","artifactClient","internalArtifactTwirpClient","getBackendIdsFromToken","listReq","listRes","ArtifactNotFoundError","sort","a","b","debug","req","res","info","__setModuleDefault","v","__importStar","mod","__importDefault","default","streamExtractExternal","promises_1","crypto","stream","core","httpClient","unzip_stream_1","scrubQueryParameters","url","parsed","URL","search","exists","path","access","code","streamExtract","directory","retryCount","setTimeout","HttpClient","response","statusCode","statusMessLine truncated
{"version":3,"file":"index.js","names":["__createBinding","this","Object","create","o","m","k","k2","undefined","desc","getOwnPropertyDescriptor","__esModule","writable","configurable","enumerable","get","defineProperty","__exportStar","exports","p","prototype","hasOwnProperty","call","value","client_1","__webpack_require__","client","DefaultArtifactClient","Timestamp","runtime_1","runtime_2","runtime_3","runtime_4","runtime_5","runtime_6","runtime_7","Timestamp$Type","MessageType","constructor","super","no","name","kind","T","now","msg","ms","Date","seconds","PbLong","from","Math","floor","toString","nanos","toDate","message","toNumber","ceil","fromDate","date","getTime","internalJsonWrite","options","parse","Error","z","nanosStr","substring","toISOString","replace","internalJsonRead","json","target","typeofJsonValue","matches","match","Number","isNaN","globalThis","parseInt","repeat","length","MESSAGE_TYPE","reflectionMergePartial","internalBinaryRead","reader","end","pos","fieldNo","wireType","tag","int64","int32","u","readUnknownField","typeName","d","skip","UnknownFieldHandler","onRead","internalBinaryWrite","writer","WireType","Varint","writeUnknownFields","onWrite","BytesValue","StringValue","BoolValue","UInt32Value","Int32Value","UInt64Value","Int64Value","FloatValue","DoubleValue","DoubleValue$Type","refJsonWriter","scalar","refJsonReader","double","Bit64","FloatValue$Type","float","Bit32","Int64Value$Type","ScalarType","INT64","LongType","STRING","UInt64Value$Type","UINT64","uint64","Int32Value$Type","UInt32Value$Type","uint32","BoolValue$Type","bool","StringValue$Type","string","LengthDelimited","BytesValue$Type","Uint8Array","bytes","ArtifactService","DeleteArtifactResponse","DeleteArtifactRequest","GetSignedArtifactURLResponse","GetSignedArtifactURLRequest","ListArtifactsResponse_MonolithArtifact","ListArtifactsResponse","ListArtifactsRequest","FinalizeArtifactResponse","FinalizeArtifactRequest","CreateArtifactResponse","CreateArtifactRequest","FinalizeMigratedArtifactResponse","FinalizeMigratedArtifactRequest","MigrateArtifactResponse","MigrateArtifactRequest","runtime_rpc_1","wrappers_1","wrappers_2","timestamp_1","MigrateArtifactRequest$Type","workflowRunBackendId","expiresAt","fork","join","MigrateArtifactResponse$Type","ok","signedUploadUrl","FinalizeMigratedArtifactRequest$Type","size","FinalizeMigratedArtifactResponse$Type","artifactId","CreateArtifactRequest$Type","workflowJobRunBackendId","version","CreateArtifactResponse$Type","FinalizeArtifactRequest$Type","hash","FinalizeArtifactResponse$Type","ListArtifactsRequest$Type","nameFilter","idFilter","ListArtifactsResponse$Type","artifacts","push","i","ListArtifactsResponse_MonolithArtifact$Type","databaseId","createdAt","digest","GetSignedArtifactURLRequest$Type","GetSignedArtifactURLResponse$Type","signedUrl","DeleteArtifactRequest$Type","DeleteArtifactResponse$Type","ServiceType","I","O","ArtifactServiceClientProtobuf","ArtifactServiceClientJSON","artifact_1","rpc","CreateArtifact","bind","FinalizeArtifact","ListArtifacts","GetSignedArtifactURL","DeleteArtifact","request","data","toJson","useProtoFieldName","emitDefaultValues","promise","then","fromJson","ignoreUnknownFields","toBinary","fromBinary","__awaiter","thisArg","_arguments","P","generator","adopt","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","apply","__rest","s","t","indexOf","getOwnPropertySymbols","propertyIsEnumerable","core_1","config_1","upload_artifact_1","download_artifact_1","delete_artifact_1","get_artifact_1","list_artifacts_1","errors_1","uploadArtifact","files","rootDirectory","isGhes","GHESNotSupportedError","error","warning","downloadArtifact","findBy","repositoryOwner","repositoryName","token","downloadOptions","downloadArtifactPublic","downloadArtifactInternal","listArtifacts","workflowRunId","listArtifactsPublic","latest","listArtifactsInternal","getArtifact","artifactName","getArtifactPublic","getArtifactInternal","deleteArtifact","deleteArtifactPublic","deleteArtifactInternal","github_1","user_agent_1","retry_options_1","utils_1","plugin_request_log_1","plugin_retry_1","artifact_twirp_client_1","util_1","generated_1","_a","retryOpts","requestOpts","getRetryOptions","defaults","opts","log","userAgent","getUserAgentString","previews","retry","github","getOctokit","requestLog","getArtifactResp","deleteArtifactResp","rest","actions","owner","repo","artifact_id","artifact","id","status","InvalidResponseError","headers","artifactClient","internalArtifactTwirpClient","getBackendIdsFromToken","listReq","listRes","ArtifactNotFoundError","sort","a","b","debug","req","res","info","__setModuleDefault","v","__importStar","mod","__importDefault","default","streamExtractExternal","promises_1","crypto","stream","core","httpClient","unzip_stream_1","scrubQueryParameters","url","parsed","URL","search","exists","path","access","code","streamExtract","directory","retryCount","setTimeout","HttpClient","response","statusCode","statusMessLine truncated
+3 -3
View File
@@ -9,7 +9,7 @@ export const certsDir = process.env['STATE_certsDir'] || '';
export const tmpDockerContext = process.env['STATE_tmpDockerContext'] || '';
export const cleanup = /true/i.test(process.env['STATE_cleanup'] || '');
export const buildxIsDefaultBuilder = /true/i.test(process.env['STATE_buildxIsDefaultBuilder'] || '');
export const keepState = !!process.env['STATE_keepState'];
export const keepState = /true/i.test(process.env['STATE_keepState'] || '');
export function setDebug(debug: string) {
core.saveState('isDebug', debug);
@@ -47,6 +47,6 @@ export function setBuildxIsDefaultBuilder(buildxIsDefaultBuilder: boolean) {
core.saveState('buildxIsDefaultBuilder', buildxIsDefaultBuilder);
}
export function setKeepState(retain: boolean) {
core.saveState('keepState', retain);
export function setKeepState(keepState: boolean) {
core.saveState('keepState', keepState);
}