-
Notifications
You must be signed in to change notification settings - Fork 722
feat: Add a weekly workflow to tag archived repos #3103
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
Open
esafak
wants to merge
8
commits into
nim-lang:master
Choose a base branch
from
esafak:feature/tag-archived-repos
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit introduces a new GitHub Actions workflow that runs weekly to identify and tag archived repositories listed in `packages.json`. The workflow executes a Python script that: - Parses `packages.json` to find GitHub repositories. - Uses the `gh` CLI to query the GitHub GraphQL API in batches. - Checks if repositories are archived. - Adds the "deleted" tag to archived repositories. - Commits the changes to `packages.json`. The batch size for the GraphQL query is configurable via the `BATCH_SIZE` environment variable in the workflow file.
* Enhance the `run_gh_query` function to gracefully handle API errors and parse partial JSON responses. * Refactor the main logic to identify both archived repositories and repositories that no longer exist. * Update the `packages.json` to tag both archived and deleted repositories with a "deleted" tag. * Provide more informative output messages for repository status changes.
This commit introduces a major overhaul of the weekly package checking workflow. The script and workflow have been updated to be more robust and to handle package states more gracefully. Key changes: - **Deleted Packages**: Packages that are not found on GitHub or are already tagged as 'deleted' are now moved to a new `deleted_packages.json` file, keeping the main `packages.json` clean. - **Archived Packages**: Repositories that are archived on GitHub are now explicitly tagged with 'archived' and remain in `packages.json`. - **Robust URL Parsing**: The script now uses `urllib.parse` to correctly handle GitHub URLs, stripping any query parameters or fragments. - **Dynamic Commits**: The workflow now generates a detailed commit message listing the packages that were moved or tagged, and only commits if there are changes. - **Forge Compatibility**: The GitHub-specific logic is now more carefully applied to only GitHub URLs, preventing errors with other forges.
* Update GitHub Action checkout to v5 for `actions/checkout`. * Update GitHub Action setup-python to v5. * Update git-auto-commit-action to v6. * Enhance `tag_archived.py` to handle GitHub API results more robustly. * Add support for tagging repositories as 'archived' based on API response. * Move non-existent repositories to `deleted_packages.json`. * Improve URL parsing to handle query parameters. * Add `cglm` package to `packages.json`.
This was referenced Aug 11, 2025
The Python script doesn't look like it's doing anything that Nim couldn't do just as easily. |
Given that this script works and provides value I would do that in another PR. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit introduces a new GitHub Actions workflow that runs weekly to identify and tag archived repositories listed in
packages.json
.What it does
gh
CLI's GraphQL API in batches ofBATCH_SIZE
. The GitHub-specific logic is applied to only GitHub URLs, preventing errors with other forges.deleted_packages.json
file, keeping the mainpackages.json
clean.packages.json
.urllib.parse
to correctly handle GitHub URLs, stripping any query parameters or fragments.packages.json
. Here is an example commit.Closes #2075