mirror of
https://github.com/sune-org/store.git
synced 2026-01-13 16:17:58 +00:00
1 line
8.7 KiB
JSON
1 line
8.7 KiB
JSON
[{"id":"hmhdnfo","name":"Action Runner","pinned":false,"avatar":"data:image/webp;base64,UklGRvwGAABXRUJQVlA4WAoAAAAgAAAAfwAAfwAASUNDUMgBAAAAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAH4AABAAEAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAACRyWFlaAAABFAAAABRnWFlaAAABKAAAABRiWFlaAAABPAAAABR3dHB0AAABUAAAABRyVFJDAAABZAAAAChnVFJDAAABZAAAAChiVFJDAAABZAAAAChjcHJ0AAABjAAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEJYWVogAAAAAAAAb6IAADj1AAADkFhZWiAAAAAAAABimQAAt4UAABjaWFlaIAAAAAAAACSgAAAPhAAAts9YWVogAAAAAAAA9tYAAQAAAADTLXBhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABtbHVjAAAAAAAAAAEAAAAMZW5VUwAAACAAAAAcAEcAbwBvAGcAbABlACAASQBuAGMALgAgADIAMAAxADZWUDggDgUAAHAdAJ0BKoAAgAA+bTKWSCQioiEmEVpwgA2JaQAV53/Te1z+4ed/SY9SM4n9Pvw/CDtVf3DeWOSfzb9WdQ95Tf4jwBvo/+w9gD+Vf3j1Qv1//vf4D8gPZH+Sf1X/re4D/G/5z/zv7x7OXrS/Zb2B/1uKwRRKMV8XzF03Uy797KI8wgG9BgcUdA1vOIY8132d7PZRrgojWQ/5iY43XWiHVymoDfmJ2Qdlifxc7/OO6gciS2/kxgbjF78rrOERmx2qh4ZKaWfV4Daz4Ad7AvCxoqkeboW/S8F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ZekbhLAq6nx3JejsbzpN9Z1AUICNPA2dFxzLanELvaG7+kBHsIUfON2ORzGTAgvJ1jNsk7gAn4BagAm9vByCyW7FY0NMv2zZj0kWP2/ara2co9Sha+Q4qOQCaqUBgTa66W6zzfEyzVKg8OA2MYXF6swTGYBroi0dH+Ch6uofe3HepJ3JOOSYpy5lINGq7S/aEOj8NHgKbusoo3kKVgfMSjEGbBmKWEe94MmP/fvs1DoxZ0HRpTQJdBcEtS1bxIVH/ofbwvjrFcD2KnjDB7vx9OG3/VAC4N1fuG3ef7z+Xp8NmCisTsTd+hooDec56hlot/Puzpp1ybNK5ZoZ8lX90bPL/XFtQAAAAAA=","url":"gh://sune-org/store/github-utilities/action_runner.sune","updatedAt":1758754116169,"settings":{"model":"openai/gpt-5","temperature":"1","top_p":"0.96","top_k":"0","frequency_penalty":"0","repetition_penalty":"1","min_p":"0","top_a":"0","verbosity":"","reasoning_effort":"default","system_prompt":"","html":"<div id=\"ghRunner\" x-data class=\"p-4 space-y-4 text-sm bg-gray-50 rounded-lg border border-gray-200 relative\">\n <div class=\"flex items-center justify-between\">\n <div class=\"prose prose-sm max-w-none\">\n <h4 class=\"!mb-0\">GitHub Actions Runner</h4>\n <p class=\"!mt-1\">Trigger workflows. Requires a GitHub token with <code>repo</code> scope, set in <button @click=\"openAccountSettings()\" class=\"text-blue-600 hover:underline\">Account Settings</button>.</p>\n </div>\n <span class=\"absolute top-2 right-2 text-xs text-gray-400\">v1.1.0</span>\n </div>\n\n <div class=\"flex flex-col sm:flex-row items-stretch gap-2\">\n <div class=\"relative flex-grow\">\n <i data-lucide=\"github\" class=\"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400 pointer-events-none\"></i>\n <input type=\"text\" id=\"ghRepo\" placeholder=\"owner/repo\" class=\"w-full pl-9 pr-3 py-2 bg-white border border-gray-300 rounded-xl focus:ring-2 focus:ring-blue-500 focus:outline-none transition\">\n </div>\n <button id=\"ghFetchBtn\" class=\"px-4 py-2 bg-black text-white rounded-xl hover:bg-black/90 active:scale-[.98] transition flex items-center justify-center gap-2 disabled:opacity-70 disabled:pointer-events-none\">\n <span id=\"ghFetchTxt\">Fetch</span>\n <div id=\"ghFetchSpinner\" class=\"hidden animate-spin h-4 w-4 border-2 border-white border-t-transparent rounded-full\"></div>\n </button>\n </div>\n\n <div id=\"ghStatus\" class=\"text-gray-600 min-h-[1.25rem]\"></div>\n <div id=\"ghWorkflows\" class=\"grid grid-cols-1 md:grid-cols-2 gap-3\" data-branch=\"\"></div>\n\n</div>\n<script>\n(()=>{\n\"use strict\";\nconst el={r:$('#ghRunner'),i:$('#ghRepo'),f:$('#ghFetchBtn'),t:$('#ghFetchTxt'),s:$('#ghFetchSpinner'),m:$('#ghStatus'),w:$('#ghWorkflows')};\nif(!el.r.length)return;\nconst K='sune_gh_repo_'+(window.SUNE?.id||'d'),ico=window.lucide?.createIcons;\nconst api=async(p,o={})=>{const t=window.USER?.githubToken;if(!t)throw new Error('GitHub token not set.');return fetch(`https://api.github.com${p}`,{...o,headers:{'Authorization':`Bearer ${t}`,'Accept':'application/vnd.github.v3+json','X-GitHub-Api-Version':'2022-11-28',...o.headers}})};\nconst spin=(l,txt)=>{el.s.toggleClass('hidden',!l);el.t.text(txt);el.f.prop('disabled',l)};\nconst status=(msg,err=0)=>{el.m.html(msg).toggleClass('text-red-600',err).toggleClass('text-gray-600',!err)};\nconst render=(wfs,repo)=>{el.w.html('');if(!wfs.length)return status('No active workflows found.');wfs.forEach(w=>{const b=$('<button class=\"w-full text-left p-3 border border-gray-200 rounded-lg hover:bg-gray-50 active:bg-gray-100 transition flex items-center justify-between gap-2\"></button>');b.html(`<span class=\"font-medium truncate\">${w.name}</span><span class=\"flex items-center gap-1.5 text-xs text-gray-500\">Run<i data-lucide=\"play\" class=\"h-4 w-4\"></i></span>`);b.data({wid:w.id,wpath:w.path,repo});el.w.append(b)});ico?.()};\nconst fetchWfs=async()=>{const path=el.i.val().trim();if(!path.includes('/'))return status('Invalid format. Use \"owner/repo\".',1);spin(1,'Fetching...');status('Fetching repo details...');el.w.html('');try{const[repoRes,wfRes]=await Promise.all([api(`/repos/${path}`),api(`/repos/${path}/actions/workflows`)]);if(!repoRes.ok)throw new Error(repoRes.status===404?'Repo not found or access denied.':`Repo fetch error: ${repoRes.statusText}`);if(!wfRes.ok)throw new Error(`Workflow fetch error: ${wfRes.statusText}`);const[repoData,wfData]=await Promise.all([repoRes.json(),wfRes.json()]);el.w.data('branch',repoData.default_branch||'main');status('');render(wfData.workflows.filter(w=>w.state==='active'),path);localStorage.setItem(K,path)}catch(e){status(e.message,1)}finally{spin(0,'Fetch')}};\nconst triggerWf=async e=>{const b=$(e.target.closest('button[data-wid]'));if(!b.length)return;const{wid,wpath,repo}=b.data(),ref=el.w.data('branch'),inputs={};const orig=b.html();b.prop('disabled',1);const btnLoad=(t,s=1)=>{b.html(`<span class=\"font-medium truncate\">${t}</span>`+(s?'<div class=\"animate-spin h-4 w-4 border-2 border-gray-400 border-t-transparent rounded-full\"></div>':''));};btnLoad('Inspecting...');status(`Checking inputs in ${wpath}...`);try{const cRes=await api(`/repos/${repo}/contents/${wpath}?ref=${ref}`);if(!cRes.ok)throw new Error('Could not read workflow file.');const content=atob((await cRes.json()).content),dMatch=content.match(/on:\\s*([\\s\\S]*?)(?=\\n\\w|\\n$)/);if(dMatch?.[0].includes('workflow_dispatch')){const iMatch=dMatch[0].match(/inputs:\\s*([\\s\\S]*?)(?=\\n\\s*\\w|^\\w|\\s*$)/);if(iMatch)for(const k of[...iMatch[1].matchAll(/^\\s{2,}(\\w+):/gm)].map(m=>m[1])){const v=prompt(`Enter value for input: \"${k}\"`);if(v===null)throw new Error('Run cancelled.');inputs[k]=v}}btnLoad('Triggering...');status(`Triggering: ${b.find('span').text()}`);const dRes=await api(`/repos/${repo}/actions/workflows/${wid}/dispatches`,{method:'POST',body:JSON.stringify({ref,inputs})});if(dRes.status!==204){const err=await dRes.json().catch(()=>({}));throw new Error(err.message||`API Error: ${dRes.status}`)}status(`Triggered. <a href=\"https://github.com/${repo}/actions\" target=\"_blank\" rel=\"noopener\" class=\"text-blue-600 hover:underline\">View runs</a>.`);b.html('<span class=\"font-medium truncate text-green-600\">Triggered!</span><i data-lucide=\"check-circle\" class=\"h-4 w-4 text-green-600\"></i>');ico?.()}catch(e){status(e.message,1);b.html(orig)}finally{setTimeout(()=>{if(!b.html().includes('Triggered!'))b.html(orig);b.prop('disabled',0);ico?.()},3e3)}};\n(()=>{el.i.val(localStorage.getItem(K)||'');el.f.on('click',fetchWfs);el.i.on('keydown',e=>{if(e.key==='Enter'){e.preventDefault();fetchWfs()}});el.w.on('click',triggerWf);ico?.()})()\n})();\n</script>\n","extension_html":"<sune src='https://raw.githubusercontent.com/sune-org/store/refs/heads/main/sync.sune' private></sune>","hide_composer":true,"include_thoughts":false,"json_output":false,"ignore_master_prompt":false,"json_schema":"","presence_penalty":"0","max_tokens":""},"storage":{}}] |