Compare commits
1 Commits
fix/issue-
...
mimo/code/
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
68802dc7d9 |
@@ -1,4 +1,4 @@
|
|||||||
const GiteaApiUrl = 'https://forge.alexanderwhitestone.com/api/v1';
|
const giteaApiUrl = 'https://forge.alexanderwhitestone.com/api/v1';
|
||||||
const token = process.env.GITEA_TOKEN; // Should be stored securely in environment variables
|
const token = process.env.GITEA_TOKEN; // Should be stored securely in environment variables
|
||||||
const repos = ['hermes-agent', 'the-nexus', 'timmy-home', 'timmy-config'];
|
const repos = ['hermes-agent', 'the-nexus', 'timmy-home', 'timmy-config'];
|
||||||
|
|
||||||
@@ -13,31 +13,6 @@ const branchProtectionSettings = {
|
|||||||
// Special handling for the-nexus (CI disabled)
|
// Special handling for the-nexus (CI disabled)
|
||||||
};
|
};
|
||||||
|
|
||||||
async function applyBranchProtection(repo) {
|
|
||||||
try {
|
|
||||||
const response = await fetch(`${giteaApiUrl}/repos/Timmy_Foundation/${repo}/branches/main/protection`, {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Authorization': `token ${token}`,
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
},
|
|
||||||
body: JSON.stringify({
|
|
||||||
...branchProtectionSettings,
|
|
||||||
// Special handling for the-nexus (CI disabled)
|
|
||||||
requiredStatusChecks: repo === 'the-nexus' ? false : true
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
throw new Error(`Failed to apply branch protection to ${repo}: ${await response.text()}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(`✅ Branch protection applied to ${repo}`);
|
|
||||||
} catch (error) {
|
|
||||||
console.error(`❌ Error applying branch protection to ${repo}: ${error.message}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function applyBranchProtection(repo) {
|
async function applyBranchProtection(repo) {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${giteaApiUrl}/repos/Timmy_Foundation/${repo}/branches/main/protection`, {
|
const response = await fetch(`${giteaApiUrl}/repos/Timmy_Foundation/${repo}/branches/main/protection`, {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ const ASSETS_TO_CACHE = [
|
|||||||
|
|
||||||
self.addEventListener('install', (event) => {
|
self.addEventListener('install', (event) => {
|
||||||
event.waitUntil(
|
event.waitUntil(
|
||||||
caches.open(CachedName).then(cache => {
|
caches.open(CACHE_NAME).then(cache => {
|
||||||
return cache.addAll(ASSETS_TO_CACHE);
|
return cache.addAll(ASSETS_TO_CACHE);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user