-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from paipe-labs/client-node_comfyui-setup
client-node_comfyui-setup
- Loading branch information
Showing
5 changed files
with
87 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Clear Cache | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
actions: write | ||
|
||
jobs: | ||
clear-cache: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clear cache | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
console.log("About to clear") | ||
const response = await github.rest.actions.getActionsCacheList({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
page: 1, | ||
per_page: 100 | ||
}); | ||
const pages = (function() { | ||
if (typeof response.headers.link !== 'undefined') { | ||
return response.headers.link.split(">").slice(-2)[0].split('=').slice(-1)[0] | ||
} | ||
return 1; | ||
})(); | ||
console.log("Total pages: " + pages); | ||
for (let page = pages; page >= 1; page--) { | ||
console.log("Processing page " + page) | ||
const response = await github.rest.actions.getActionsCacheList({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
page: page, | ||
per_page: 100 | ||
}); | ||
for (const cache of response.data.actions_caches) { | ||
console.log(cache) | ||
github.rest.actions.deleteActionsCacheById({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
cache_id: cache.id, | ||
}) | ||
} | ||
} | ||
console.log("Clear completed") |
This file contains 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 file contains 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 file contains 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 file contains 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