Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for stale images every week #2531

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
22 changes: 20 additions & 2 deletions .github/workflows/weekly-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,27 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
run: npm run check:external-links -- 'docs/**/*.{md,mdx,ipynb}'

stale-images:
runs-on: ubuntu-latest
if: github.repository_owner == 'Qiskit'
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install Node.js dependencies
run: npm ci
- name: Install ripgrep
run: |
sudo apt-get update
sudo apt-get install ripgrep
- name: Check for stale images
run: npx tsx scripts/js/commands/checkStaleImages.ts

make_issue:
name: Make issue on failure
needs: [external-link-checker, pages-render]
needs: [external-link-checker, pages-render, stale-images]
if: ${{ failure() && github.event_name == 'schedule' }}
runs-on: ubuntu-latest
steps:
Expand All @@ -78,7 +96,7 @@ jobs:
github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: "Extended checks failed",
title: "Weekly quality checks failed",
body: message,
labels: ["infra 🏗️"],
})
2 changes: 1 addition & 1 deletion scripts/js/commands/checkStaleImages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ zxMain(async () => {
"\n\n❌ Some images are unused. They should usually be deleted to reduce our repository size.",
);
console.warn(
"⚠️ Be careful that some of these images may be used in closed source. Before deleting files, check for their usage there. If they're unused, add it to the allowlist.",
"⚠️ Be careful that some of these images may be used in closed source. Before deleting files, check for their usage there. If they're unused, add it to ALLOW_LIST in scripts/js/commands/checkStaleImages.ts.",
);
process.exit(1);
}
Expand Down
Loading