-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ci): add cleanup workflow to retain
generated-docs-preview
for …
…only the last 25 PRs (#2758) ## Description <!-- A summary of what this pull request achieves and a rough list of changes. --> ## Breaking Changes <!-- Optional, if there are any breaking changes document them, including how to migrate older code. --> ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist - [ ] Self-review. - [ ] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [ ] Tests if relevant. - [ ] All breaking changes documented.
- Loading branch information
Showing
2 changed files
with
66 additions
and
5 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,45 @@ | ||
# Run tests using the beta Rust compiler | ||
|
||
name: Cleanup | ||
|
||
on: | ||
schedule: | ||
# 06:50 UTC every Monday | ||
- cron: '50 6 * * 1' | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: beta-${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
IROH_FORCE_STAGING_RELAYS: "1" | ||
|
||
jobs: | ||
clean_docs_branch: | ||
permissions: | ||
issues: write | ||
contents: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: generated-docs-preview | ||
- name: Clean docs branch | ||
run: | | ||
cd pr/ | ||
# keep the last 25 prs | ||
dirs=$(ls -1d [0-9]* | sort -n) | ||
total_dirs=$(echo "$dirs" | wc -l) | ||
dirs_to_remove=$(echo "$dirs" | head -n $(($total_dirs - 25))) | ||
if [ -n "$dirs_to_remove" ]; then | ||
echo "$dirs_to_remove" | xargs rm -rf | ||
fi | ||
git add . | ||
git commit -m "Cleanup old docs" | ||
git push | ||
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