Skip to content

Add support to get all runs regardless the workflow file exists #176

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

Conversation

igorjs
Copy link
Owner

@igorjs igorjs commented Jul 3, 2025

Closes #169

📑 Description

Add support to get all runs regardless the workflow file exists

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

@igorjs igorjs requested a review from Copilot July 3, 2025 15:48
@igorjs igorjs self-assigned this Jul 3, 2025
@igorjs igorjs added the enhancement New feature or request label Jul 3, 2025
Copilot

This comment was marked as outdated.

@igorjs igorjs force-pushed the 169-it-can-only-delete-the-logs-generate-by-yml-files-which-exist-in-the-repo branch 2 times, most recently from 90e1402 to 2f4aa33 Compare July 3, 2025 16:39
@igorjs igorjs requested a review from Copilot July 3, 2025 16:40
@igorjs igorjs force-pushed the 169-it-can-only-delete-the-logs-generate-by-yml-files-which-exist-in-the-repo branch from 2f4aa33 to 3688299 Compare July 3, 2025 16:41
Copilot

This comment was marked as outdated.

@igorjs igorjs requested a review from Copilot July 3, 2025 16:45
@igorjs igorjs merged commit f308be9 into main Jul 3, 2025
3 checks passed
@igorjs igorjs deleted the 169-it-can-only-delete-the-logs-generate-by-yml-files-which-exist-in-the-repo branch July 3, 2025 16:46
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the workflow‐run deletion logic to fetch and delete runs across all workflows (regardless of whether the workflow file still exists), simplifies the main action entrypoint, removes old date utilities, and bumps the package version.

  • Refactor getApi to introduce getRunsToDelete, unifying run pagination and grouping logic.
  • Update src/index.ts to call getRunsToDelete and streamline logging.
  • Remove obsolete date utilities in src/utils/date.ts and adjust related code/tests.

Reviewed Changes

Copilot reviewed 14 out of 17 changed files in this pull request and generated 1 comment.

File Description
src/helpers/api.ts Refactored to paginate all workflow runs and group them in getRunsToDelete
src/index.ts Updated main entrypoint to use new deletion API and improved logging
src/utils/date.ts Deleted outdated date‐difference utilities no longer in use
Comments suppressed due to low confidence (2)

eslint.config.js:78

  • There’s a duplicate js.configs.recommended entry at the end of the ESLint configuration. Removing this duplicate will prevent rules from being applied twice and keep the config clearer.
];

src/index.ts:11

  • The new main entrypoint in src/index.ts isn’t covered by any tests. Consider adding tests that simulate both the "no runs to delete" and "successful deletion" paths to validate logging and error handling.
(async function run() {

@@ -1,6 +1,6 @@
{
"name": "@igorjs/gh-actions-clean-workflow",
"version": "6.0.0",
"version": "7.0.0",
"description": "Github Action to delete old workflow runs",
Copy link
Preview

Copilot AI Jul 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the description to use the official GitHub capitalization: e.g., "GitHub Action to delete old workflow runs".

Suggested change
"description": "Github Action to delete old workflow runs",
"description": "GitHub Action to delete old workflow runs",

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

It can only delete the logs generate by yml files which exist in the repo.
1 participant