Compare commits

...
50 Commits
Author SHA1 Message Date
xixu-me 79160d8e48 fix(actions): avoid status event fan-out 2026-08-18 11:29:52 +08:00
xixu-me 6cb31d980b fix(actions): retry Dependabot merge after checks 2026-08-18 11:25:20 +08:00
xixu-me bfc0d3a728 fix(deps): remove invalid pip update 2026-08-17 10:48:25 +08:00
xixu-me 467839838a fix(ci): evaluate all Dependabot pull requests 2026-08-14 18:15:04 +08:00
xixu-me feb6820295 ci: trigger Dependabot auto-merge from workflow runs 2026-07-03 23:31:40 +08:00
xixu-me e1ef383c60 ci: tolerate protected Dependabot workflow updates 2026-07-03 23:12:07 +08:00
github-actions[bot] 0bfb9e5f3e Merge pull request #13 from xixu-me/dependabot/github_actions/actions/checkout-7
ci(deps): bump actions/checkout from 6 to 7
2026-07-03 15:08:35 +00:00
xixu-me 20702e856e ci: add Dependabot auto merge workflow 2026-07-03 23:01:17 +08:00
dependabot[bot] d6f4a12a8c ci(deps): bump actions/checkout from 6 to 7
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-22 02:05:50 +00:00
xixu-me 7fc18b9c1e Merge pull request #12 from xixu-me/dependabot/github_actions/softprops/action-gh-release-3
ci(deps): bump softprops/action-gh-release from 2 to 3
2026-04-13 10:32:08 +08:00
dependabot[bot] 1f0fa6e20b ci(deps): bump softprops/action-gh-release from 2 to 3
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2 to 3.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2...v3)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: '3'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-13 02:11:02 +00:00
xixu-me 569864caa9 Merge pull request #10 from xixu-me/dependabot/github_actions/actions/upload-artifact-7
ci(deps): bump actions/upload-artifact from 6 to 7
2026-03-02 13:53:50 +08:00
xixu-me 2eba53d6ef Merge pull request #11 from xixu-me/dependabot/github_actions/actions/download-artifact-8
ci(deps): bump actions/download-artifact from 7 to 8
2026-03-02 13:53:30 +08:00
dependabot[bot] d8cfbdcf17 ci(deps): bump actions/download-artifact from 7 to 8
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 7 to 8.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-02 02:11:59 +00:00
dependabot[bot] 72ee38618c ci(deps): bump actions/upload-artifact from 6 to 7
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-02 02:11:56 +00:00
xixu-me 68a8ff1894 Merge pull request #9 from xixu-me/dependabot/github_actions/actions/download-artifact-7
ci(deps): bump actions/download-artifact from 6 to 7
2025-12-15 11:52:21 +08:00
xixu-me 7fc4b99b26 Merge pull request #8 from xixu-me/dependabot/github_actions/actions/upload-artifact-6
ci(deps): bump actions/upload-artifact from 5 to 6
2025-12-15 11:52:09 +08:00
dependabot[bot] 986a63f833 ci(deps): bump actions/download-artifact from 6 to 7
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 02:21:09 +00:00
dependabot[bot] d7d4c1b4ec ci(deps): bump actions/upload-artifact from 5 to 6
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 02:21:06 +00:00
xixu-me da8c91ea62 Merge pull request #7 from xixu-me/dependabot/github_actions/actions/checkout-6
ci(deps): bump actions/checkout from 5 to 6
2025-11-24 13:07:38 +08:00
dependabot[bot] dd1cb3bc7b ci(deps): bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-24 02:26:07 +00:00
xixu-me 4b85134e03 Merge pull request #5 from xixu-me/dependabot/github_actions/actions/upload-artifact-5
ci(deps): bump actions/upload-artifact from 4 to 5
2025-10-27 10:39:41 +08:00
xixu-me 36c2b3ab7c Merge pull request #6 from xixu-me/dependabot/github_actions/actions/download-artifact-6
ci(deps): bump actions/download-artifact from 5 to 6
2025-10-27 10:39:10 +08:00
dependabot[bot] 7497ef6a44 ci(deps): bump actions/download-artifact from 5 to 6
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-27 02:37:07 +00:00
dependabot[bot] 8a1b662b6b ci(deps): bump actions/upload-artifact from 4 to 5
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-27 02:35:25 +00:00
xixu-me 5fbef10b71 Update favicon access URLs in README
Revised the example URLs for accessing favicons directly and via jsDelivr CDN to include the correct path with 'refs/heads/assets/favicons/'.
2025-08-31 19:17:35 +08:00
xixu-me ce5ac10be6 Merge pull request #4 from xixu-me/dependabot/github_actions/actions/checkout-5
ci(deps): bump actions/checkout from 4 to 5
2025-08-18 13:14:46 +08:00
dependabot[bot] 0aeb6dab11 ci(deps): bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-18 04:34:23 +00:00
xixu-me e8de703dba Merge pull request #3 from xixu-me/dependabot/github_actions/actions/download-artifact-5
ci(deps): bump actions/download-artifact from 4 to 5
2025-08-11 12:16:04 +08:00
dependabot[bot] 0e6d9a77e2 ci(deps): bump actions/download-artifact from 4 to 5
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-11 04:07:06 +00:00
xixu-me bbd9818747 Merge pull request #2 from xixu-me/dependabot/github_actions/softprops/action-gh-release-2
ci(deps): bump softprops/action-gh-release from 1 to 2
2025-06-30 03:09:17 +08:00
dependabot[bot] b20f2c96c5 ci(deps): bump softprops/action-gh-release from 1 to 2
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 1 to 2.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v1...v2)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: '2'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-29 19:08:36 +00:00
xixu-me 4007836d77 Create dependabot.yml 2025-06-30 03:08:00 +08:00
xixu-me 7a4c053537 Remove high failure rate detection in workflow
Eliminated the logic that stopped execution if favicon download failures exceeded 80% after 100 domains. The workflow will now continue processing all domains regardless of failure rate.
2025-06-10 18:09:46 +08:00
xixu-me c07a5ffa42 Update favicon naming conventions
Updated the favicon naming conventions in both the workflow file and README to use the full domain name instead of the second-level domain. This ensures unique filenames and preserves complete domain information.
2025-06-10 16:00:40 +08:00
xixu-me 570fa27e90 Simplify favicon filename generation in workflow
Removed the use of associative arrays and second-level domain logic for favicon filename generation. Filenames now use the full domain directly, simplifying the code and reducing complexity.
2025-06-10 15:54:18 +08:00
xixu-me f03737d97f Improve favicon download logic in workflow
Revised the favicon download logic to use temporary files and associative arrays for better handling of duplicate filenames and sequential numbering. Enhanced error handling and ensured proper file renaming after successful downloads.
2025-06-10 15:46:13 +08:00
xixu-me 33a95d810d Remove jsDelivr CDN cache purge step
The step to purge jsDelivr CDN cache for the assets branch has been removed from the GitHub Actions workflow. This change simplifies the workflow by eliminating unnecessary cache management.
2025-06-10 15:26:21 +08:00
xixu-me 73f5792e22 Add jsDelivr CDN link to README
Updated the README to include a jsDelivr CDN link for accessing favicons, providing better performance and global availability.
2025-06-10 11:19:11 +08:00
xixu-me ebc102fd60 Refactor jsDelivr cache purge in workflow
Replaced the standalone 'purge-jsdelivr-cache' job with an inline step in the main workflow. The new implementation purges jsDelivr CDN cache for PNG files in the 'favicons' directory, improving progress tracking and simplifying the workflow structure.
2025-06-10 11:10:14 +08:00
xixu-me 76906d5e5f Remove Dependabot config and update workflow
Deleted the Dependabot configuration file as it is no longer needed. Updated the GitHub Actions workflow to simplify the installation step for the 'tzst' tool by adjusting the log message.
2025-06-10 10:51:59 +08:00
xixu-me 8277950c8e Add jsDelivr cache purge workflow
Introduced a new workflow step to purge the jsDelivr CDN cache after processing favicons and releases. Updated the GitHub Release action to use version v1 for better compatibility.
2025-06-10 10:47:20 +08:00
xixu-me 18bf739e96 Update GitHub Release action version
Bumped the version of softprops/action-gh-release from v2 to v2.3.0 in the GitHub Actions workflow to ensure compatibility and access to the latest features.
2025-06-10 10:42:19 +08:00
xixu-me 742240c8c8 Update permissions in GitHub Actions workflow
Adjusted permissions for jobs in the workflow file to ensure appropriate access levels. Updated global and job-specific permissions for better security and functionality.
2025-06-10 10:34:46 +08:00
xixu-me c70eb40236 Update domain count list in README
Removed the 'minimal' label for the 200 domain count and removed entries for 500,000 and 1,000,000 domain counts from the README.
2025-06-10 10:21:32 +08:00
xixu-me b5b4a0c4d9 Merge branch 'main' of https://github.com/xixu-me/favicons 2025-06-10 10:19:00 +08:00
xixu-me 0930dc6447 Merge pull request #1 from xixu-me/dependabot/github_actions/softprops/action-gh-release-2
Bump softprops/action-gh-release from 1 to 2
2025-06-09 23:37:47 +08:00
dependabot[bot] 55876e6acf Bump softprops/action-gh-release from 1 to 2
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 1 to 2.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v1...v2)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: '2'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-09 14:31:38 +00:00
xixu-me 1df82c4c77 Update dependabot.yml 2025-06-09 22:02:22 +08:00
xixu-me 86dffb5f90 Create dependabot.yml 2025-06-09 22:00:11 +08:00
4 changed files with 276 additions and 62 deletions

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
version: 2
updates:
# Monitor GitHub Actions dependencies
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "02:00"
timezone: "UTC"
open-pull-requests-limit: 5
reviewers:
- "xixu-me"
assignees:
- "xixu-me"
commit-message:
prefix: "ci"
include: "scope"
labels:
- "dependencies"
- "github-actions"
+202
View File
@@ -0,0 +1,202 @@
name: Dependabot Auto Merge
on:
check_suite:
types: [completed]
workflow_run:
workflows:
- "CodeQL"
- "Dependabot Updates"
- "The Workflow"
types:
- completed
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch || github.run_id }}
cancel-in-progress: false
permissions:
contents: write
pull-requests: write
checks: read
statuses: read
jobs:
merge:
name: Auto-merge Dependabot PRs
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Merge Dependabot PRs when checks pass
uses: actions/github-script@v9
with:
script: |
const owner = context.repo.owner;
const repo = context.repo.repo;
const successfulCheckConclusions = new Set(["success", "skipped", "neutral"]);
const successfulStatusStates = new Set(["success"]);
const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
const latestBy = (items, keyOf, timeOf) => {
const latest = new Map();
for (const item of items) {
const key = keyOf(item);
const itemTime = new Date(timeOf(item) || 0).getTime();
const existing = latest.get(key);
const existingTime = existing ? new Date(timeOf(existing) || 0).getTime() : -1;
if (!existing || itemTime >= existingTime) {
latest.set(key, item);
}
}
return [...latest.values()];
};
const findCandidatePulls = async () => {
const pulls = await github.paginate(github.rest.pulls.list, {
owner,
repo,
state: "open",
per_page: 100,
});
return pulls.filter((pr) => pr.user?.login === "dependabot[bot]");
};
const getMergeablePullRequest = async (pull_number) => {
for (let attempt = 1; attempt <= 6; attempt += 1) {
const { data: pr } = await github.rest.pulls.get({ owner, repo, pull_number });
if (pr.mergeable !== null) {
return pr;
}
core.info("PR #" + pull_number + " mergeability is still being computed; retry " + attempt + "/6.");
await wait(5000);
}
const { data: pr } = await github.rest.pulls.get({ owner, repo, pull_number });
return pr;
};
const getSignalState = async (sha) => {
const checkRuns = await github.paginate(github.rest.checks.listForRef, {
owner,
repo,
ref: sha,
per_page: 100,
});
const statuses = await github.paginate(github.rest.repos.listCommitStatusesForRef, {
owner,
repo,
ref: sha,
per_page: 100,
});
const latestChecks = latestBy(
checkRuns.filter((run) => run.name !== "Dependabot Auto Merge"),
(run) => (run.app?.slug || "unknown") + ":" + run.name,
(run) => run.completed_at || run.started_at || run.created_at,
);
const latestStatuses = latestBy(statuses, (status) => status.context, (status) => status.updated_at || status.created_at);
const pendingChecks = latestChecks.filter((run) => run.status !== "completed");
const failedChecks = latestChecks.filter(
(run) => run.status === "completed" && !successfulCheckConclusions.has(String(run.conclusion || "").toLowerCase()),
);
const failedStatuses = latestStatuses.filter((status) => !successfulStatusStates.has(String(status.state || "").toLowerCase()));
return {
totalSignals: latestChecks.length + latestStatuses.length,
pendingChecks,
failedChecks,
failedStatuses,
};
};
const { data: repository } = await github.rest.repos.get({ owner, repo });
const mergeMethods = [];
if (repository.allow_merge_commit) mergeMethods.push("merge");
if (repository.allow_squash_merge) mergeMethods.push("squash");
if (repository.allow_rebase_merge) mergeMethods.push("rebase");
if (mergeMethods.length === 0) {
core.info("This repository has no enabled pull request merge methods.");
return;
}
const pulls = await findCandidatePulls();
if (pulls.length === 0) {
core.info("No open Dependabot PRs to evaluate.");
return;
}
for (const candidate of pulls) {
const pull_number = candidate.number;
const pr = await getMergeablePullRequest(pull_number);
if (pr.user?.login !== "dependabot[bot]") {
core.info("PR #" + pull_number + " is no longer a Dependabot PR.");
continue;
}
if (pr.state !== "open" || pr.draft) {
core.info("PR #" + pull_number + " is not an open, ready PR.");
continue;
}
if (pr.mergeable !== true) {
core.info("PR #" + pull_number + " is not currently mergeable.");
continue;
}
const signalState = await getSignalState(pr.head.sha);
if (signalState.totalSignals === 0) {
core.info("PR #" + pull_number + " has no checks or statuses yet; skipping.");
continue;
}
if (signalState.pendingChecks.length > 0) {
core.info("PR #" + pull_number + " still has pending checks: " + signalState.pendingChecks.map((run) => run.name).join(", ") + ".");
continue;
}
if (signalState.failedChecks.length > 0 || signalState.failedStatuses.length > 0) {
const failedChecks = signalState.failedChecks.map((run) => run.name + "=" + run.conclusion).join(", ");
const failedStatuses = signalState.failedStatuses.map((status) => status.context + "=" + status.state).join(", ");
core.info("PR #" + pull_number + " is not green. Checks: " + (failedChecks || "none") + ". Statuses: " + (failedStatuses || "none") + ".");
continue;
}
let merged = false;
let lastError = null;
for (const merge_method of mergeMethods) {
try {
await github.rest.pulls.merge({ owner, repo, pull_number, merge_method });
core.info("Merged Dependabot PR #" + pull_number + " with " + merge_method + ".");
merged = true;
break;
} catch (error) {
lastError = error;
if (error.status === 403 || error.status === 405 || error.status === 409) {
core.info("Cannot merge PR #" + pull_number + " with " + merge_method + ": " + error.message);
continue;
}
throw error;
}
}
if (!merged) {
core.info("PR #" + pull_number + " could not be merged: " + (lastError?.message || "unknown error") + ".");
continue;
}
if (pr.head.repo?.full_name === owner + "/" + repo) {
try {
await github.rest.git.deleteRef({ owner, repo, ref: "heads/" + pr.head.ref });
core.info("Deleted branch " + pr.head.ref + ".");
} catch (error) {
core.info("Could not delete branch " + pr.head.ref + ": " + error.message);
}
}
}
+38 -48
View File
@@ -13,18 +13,20 @@ on:
default: "200000"
type: string
# Add permissions for the workflow
permissions:
contents: write
actions: read
env:
# Default domain count (can be overridden by workflow input)
DOMAIN_COUNT: ${{ github.event.inputs.domain_count || '200000' }}
# Global permissions for the workflow
permissions:
contents: write
actions: write
jobs:
validate-input:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Validate domain count input
run: |
@@ -38,10 +40,13 @@ jobs:
fetch-domain-list:
runs-on: ubuntu-latest
needs: validate-input
permissions:
contents: read
actions: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Fetch top domains from Cloudflare Radar API
run: |
@@ -58,7 +63,7 @@ jobs:
echo "Domain list processed. Total domains: $(wc -l < domains)"
- name: Upload domain list as artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: domain-list-artifact
path: domains
@@ -67,13 +72,16 @@ jobs:
process-favicons-and-release:
runs-on: ubuntu-latest
needs: fetch-domain-list
permissions:
contents: write
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Download domain list artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: domain-list-artifact
path: .
@@ -95,9 +103,6 @@ jobs:
success_count=0
error_count=0
# Array to track used filenames for duplicate handling
declare -A filename_count
# Read domains file line by line
while IFS= read -r domain; do
counter=$((counter + 1))
@@ -112,62 +117,47 @@ jobs:
echo "Progress: $counter/$total_domains domains processed (Success: $success_count, Errors: $error_count)"
fi
# Extract second-level domain (remove top-level domain)
# For example: google.com -> google, github.io -> github
second_level_domain=$(echo "$domain" | sed 's/\.[^.]*$//')
# Handle duplicate filenames by adding sequential numbers
base_filename="$second_level_domain"
if [[ -n "${filename_count[$base_filename]}" ]]; then
# Increment count for this filename
filename_count[$base_filename]=$((filename_count[$base_filename] + 1))
final_filename="${base_filename}_${filename_count[$base_filename]}"
else
# First occurrence of this filename
filename_count[$base_filename]=0
final_filename="$base_filename"
fi
# Construct favicon URL
favicon_url="https://t1.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=https://${domain}&size=256"
favicon_file="favicons/${final_filename}.png"
# Temporarily use a temp file for download
temp_favicon_file="favicons/temp_favicon.png"
# Download favicon with enhanced error handling and timeout
if timeout 15 curl -L -s -o "$favicon_file" "$favicon_url" --max-time 10 --retry 3 --retry-delay 1; then
if timeout 15 curl -L -s -o "$temp_favicon_file" "$favicon_url" --max-time 10 --retry 3 --retry-delay 1; then
# Check if file was actually downloaded and has content
if [ -s "$favicon_file" ]; then
if [ -s "$temp_favicon_file" ]; then
# Calculate SHA-256 hash of the downloaded file
file_hash=$(sha256sum "$favicon_file" | cut -d' ' -f1)
file_hash=$(sha256sum "$temp_favicon_file" | cut -d' ' -f1)
# Check if the hash matches the failure hash
if [ "$file_hash" = "59bfe9bc385ad69f50793ce4a53397316d7a875a7148a63c16df9b674c6cda64" ]; then
# This is a failed download (generic/default favicon)
rm -f "$favicon_file"
rm -f "$temp_favicon_file"
error_count=$((error_count + 1))
echo "Warning: Generic favicon detected for domain: $domain (mapped to $final_filename) (SHA-256: $file_hash)"
echo "Warning: Generic favicon detected for domain: $domain (SHA-256: $file_hash)"
else
# Valid favicon downloaded - use domain as filename
favicon_file="favicons/${domain}.png"
mv "$temp_favicon_file" "$favicon_file"
# Valid favicon downloaded
success_count=$((success_count + 1))
echo "Success: Downloaded favicon for $domain -> $final_filename.png"
echo "Success: Downloaded favicon for $domain -> ${domain}.png"
fi
else
# Remove empty file
rm -f "$favicon_file"
rm -f "$temp_favicon_file"
error_count=$((error_count + 1))
echo "Warning: Empty file for domain: $domain (mapped to $final_filename)"
echo "Warning: Empty file for domain: $domain"
fi
else
# Remove any partial file
rm -f "$favicon_file"
rm -f "$temp_favicon_file"
error_count=$((error_count + 1))
echo "Error: Failed to download favicon for domain: $domain (mapped to $final_filename)"
fi
# Add high failure rate detection (stop if >80% failures after 100 domains)
if [ $counter -gt 100 ] && [ $((error_count * 100 / counter)) -gt 80 ]; then
echo "Error: High failure rate detected (${error_count}/${counter}). Stopping execution."
exit 1
echo "Error: Failed to download favicon for domain: $domain"
fi
done < domains
echo "Favicon download completed!"
@@ -201,9 +191,9 @@ jobs:
git push origin assets --force
fi
- name: Install tzst compression tool
- name: Install tzst
run: |
echo "Installing tzst compression tool..."
echo "Installing tzst..."
pip install tzst
tzst --version
@@ -231,7 +221,7 @@ jobs:
echo "Generated release tag: $TAG"
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ steps.tag.outputs.tag }}
name: "Archive (Top ${{ env.DOMAIN_COUNT }}) - ${{ steps.tag.outputs.tag }}"
+15 -14
View File
@@ -14,15 +14,21 @@ This repository hosts a collection of favicon images for the world's most popula
### Access Individual Favicons
Individual favicons are stored in the `assets` branch and are named according to their second-level domain:
Individual favicons are stored in the `assets` branch and are named according to their domain name:
- `google.png` for google.com
- `github.png` for github.com
- `google.com.png` for google.com
- `github.com.png` for github.com
Access patterns:
```
https://raw.githubusercontent.com/xixu-me/favicons/assets/DOMAIN_NAME.png
https://raw.githubusercontent.com/xixu-me/favicons/refs/heads/assets/favicons/DOMAIN_NAME.png
```
For better performance and global availability, you can access the favicons through jsDelivr CDN:
```
https://cdn.jsdelivr.net/gh/xixu-me/favicons@refs/heads/assets/favicons/DOMAIN_NAME.png
```
### Download Compressed Archives
@@ -46,7 +52,7 @@ tzst x archive.tzst
Archives are available with the following domain counts:
- 200 (minimal)
- 200
- 500
- 1,000
- 2,000
@@ -56,8 +62,6 @@ Archives are available with the following domain counts:
- 50,000
- 100,000
- 200,000
- 500,000
- 1,000,000 (complete set)
## Self-Build Instructions
@@ -110,15 +114,12 @@ You can modify the run.yml file to change:
### File Naming
Favicons are named based on the second-level domain:
Favicons are named using the domain name:
- `example.com` → `example.png`
- `subdomain.example.com` → `example.png`
- `example.com` → `example.com.png`
- `subdomain.example.com` → `subdomain.example.com.png`
When duplicate second-level domains exist, sequential numbers are added:
- First `github.io` domain → `github.png`
- Second `github.io` domain → `github_1.png`
This ensures unique filenames for all domains and preserves the complete domain information.
### Error Handling