Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ MANAGER_DOWNLOADERS_ASSET_REGEX=apk$

CONTRIBUTORS_REPOS=revanced-manager:ReVanced Manager,revanced-patches:ReVanced Patches,revanced-cli:ReVanced CLI,revanced-documentation:ReVanced Documentation,revanced-website:ReVanced Website,revanced-patcher:ReVanced Patcher,revanced-api:ReVanced API,revanced-manager-downloaders:ReVanced Manager Downloaders,revanced-bots:ReVanced Bots,revanced-library:ReVanced Library,revanced-patches-gradle-plugin:ReVanced Patches Gradle Plugin,revanced-patches-template:ReVanced Patches Template,revanced-cloudflare-email-worker:ReVanced Cloudflare Email Worker,revanced-encrypt:ReVanced Encrypt,revanced-vote:ReVanced Vote,revanced-invoice:ReVanced Invoice,revanced-manager-downloaders-template:ReVanced Manager Downloaders Template,revanced-branding:ReVanced Branding

IGNORED_CONTRIBUTORS=semantic-release-bot,revanced-bot,dependabot[bot],github-actions[bot],pre-commit-ci[bot]

API_VERSION=5
2 changes: 2 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface Config {
downloadersAssetRegex: RegExp;
};
contributorRepos: { repo: string; name: string }[];
ignoredContributors: string[];
apiVersion: string;
}

Expand All @@ -42,6 +43,7 @@ export function getConfig(env: Env): Config {
const [repo, ...nameParts] = entry.trim().split(':');
return { repo: repo.trim(), name: nameParts.join(':').trim() };
}),
ignoredContributors: env.IGNORED_CONTRIBUTORS.split(",").map((entry) => entry.trim()),
apiVersion: env.API_VERSION
});
}
Expand Down
6 changes: 4 additions & 2 deletions src/services/contributors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ import type { Env } from '../types';

export async function getContributors(env: Env) {
const backend = getBackend(env);
const { organization, contributorRepos } = getConfig(env);
const { organization, contributorRepos, ignoredContributors } = getConfig(env);

const results = await Promise.all(
contributorRepos.map(async ({ repo, name }) => {
const contributors = await backend.contributors(organization, repo);
return {
name,
url: backend.repositoryUrl(organization, repo),
contributors: contributors.map((contributor) => ({
contributors: contributors
.filter((contributor) => !ignoredContributors.includes(contributor.name))
.map((contributor) => ({
name: contributor.name,
avatar_url: contributor.avatarUrl,
url: contributor.url,
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ export interface Env {
MANAGER_DOWNLOADERS_ASSET_REGEX: string;
PATCHES_PUBLIC_KEY_FILE: string;
CONTRIBUTORS_REPOS: string;
IGNORED_CONTRIBUTORS: string;
API_VERSION: string;
}