// @bun
import{appendFileSync as u,readFileSync as m}from"fs";var y=/^# ---- .+ ----$/;function l(e,n){let t=[],r=new Set,v=n?.skipSections??new Set,p=!1,s=!1,o=!1;for(let S of e.split(/\r?\n/)){let i=S.trim();if(y.test(i)){p=v.has(i),s=!1,o=!1;continue}if(p)continue;if(i.startsWith("#")){if(i.includes("@required"))s=!0;if(i.includes("@sensitive"))o=!0;continue}let c=i.match(/^([A-Z][A-Z0-9_]*)=/);if(!c?.[1]){s=!1,o=!1;continue}let a=c[1];if(!r.has(a))r.add(a),t.push({key:a,required:s,sensitive:o});s=!1,o=!1}return t}function d(e,n){return l(m(e,"utf8"),n)}async function f(e,n){let t=await e.text();if(!t)throw Error(`${n} returned an empty response (${e.status})`);try{return JSON.parse(t)}catch{throw Error(`${n} returned invalid JSON (${e.status}): ${t}`)}}function E(e){let n=m(e,"utf8");return Object.fromEntries(n.split(/\r?\n/).filter(Boolean).map((t)=>{let r=t.indexOf("=");return[t.slice(0,r),t.slice(r+1)]}))}function _(e){let n=process.env[e];if(!n)throw Error(`Missing ${e}`);return n}function h(e,n){let t=process.env.GITHUB_OUTPUT;if(t)u(t,`${e}=${n}
`)}function g(e,n){let t=process.env.GITHUB_ENV;if(t)u(t,`${e}=${n}
`)}export{h as writeGitHubOutput,g as writeGitHubEnv,_ as requireEnv,f as readJsonResponse,d as parseEnvSchemaFile,l as parseEnvSchema,E as parseEnvFile};

//# debugId=3A2D3423B108DC4764756E2164756E21
//# sourceMappingURL=deploy.js.map
