GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — upgrade@5090486305 (#4) · probe-lab/github-mgmt@f4cd1d4

This repository was archived by the owner on Sep 26, 2025. It is now read-only.

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • scripts/src/actions/shared
    • add-label-to-all-repos.ts
    • set-property-in-all-repos.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎scripts/src/actions/shared/add-label-to-all-repos.ts‎

Copy file name to clipboard
+13-23Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,31 @@
11
import {Config} from '../../yaml/config'
22
import {Repository} from '../../resources/repository'
3-
import {GitHub} from '../../github'
4-
import env from '../../env'
3+
import {RepositoryLabel} from '../../resources/repository-label'
54
import * as core from '@actions/core'
65

76
export async function addLabelToAllRepos(
8-
label: string,
9-
color: string,
10-
description: string,
7+
name: string,
8+
color: string | undefined = undefined,
9+
description: string | undefined = undefined,
1110
repositoryFilter: (repository: Repository) => boolean = () => true
1211
): Promise<void> {
1312
const config = Config.FromPath()
14-
const github = await GitHub.getGitHub()
1513

1614
const repositories = config
1715
.getResources(Repository)
1816
.filter(r => !r.archived)
1917
.filter(repositoryFilter)
2018

2119
for (const repository of repositories) {
22-
// labels are not supported by GitHub Management yet
23-
const labels = await github.client.paginate(
24-
github.client.issues.listLabelsForRepo,
25-
{
26-
owner: env.GITHUB_ORG,
27-
repo: repository.name
28-
}
29-
)
30-
if (!labels.map(l => l.name).includes(label)) {
31-
core.info(`Adding label ${label} to ${repository.name}`)
32-
await github.client.issues.createLabel({
33-
owner: env.GITHUB_ORG,
34-
repo: repository.name,
35-
name: label,
36-
color: color,
37-
description: description
38-
})
20+
const label = new RepositoryLabel(repository.name, name)
21+
label.color = color
22+
label.description = description
23+
24+
if (!config.someResource(label)) {
25+
core.info(`Adding ${label.name} file to ${label.repository} repository`)
26+
config.addResource(label)
3927
}
4028
}
29+
30+
config.save()
4131
}
Collapse file

‎scripts/src/actions/shared/set-property-in-all-repos.ts‎

Copy file name to clipboard
+29Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import {Config} from '../../yaml/config'
2+
import {Repository} from '../../resources/repository'
3+
import * as core from '@actions/core'
4+
5+
export async function setPropertyInAllRepos(
6+
name: keyof Repository,
7+
value: any,
8+
repositoryFilter: (repository: Repository) => boolean = () => true
9+
): Promise<void> {
10+
const config = Config.FromPath()
11+
12+
const repositories = config
13+
.getResources(Repository)
14+
.filter(r => !r.archived)
15+
.filter(repositoryFilter)
16+
17+
for (const repository of repositories) {
18+
const v = (repository as any)[name]
19+
if (v !== value) {
20+
;(repository as any)[name] = value
21+
core.info(
22+
`Setting ${name} property to ${value} for ${repository.name} repository`
23+
)
24+
config.addResource(repository)
25+
}
26+
}
27+
28+
config.save()
29+
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.