Files
iroh/.github/workflows/cleanup.yaml
Asmir Avdicevic 89ed3bfdaf ci(secruity): hardening + lock files + dependabot cooldown (#4480)
## Description

Same pricinple as https://github.com/n0-computer/noq/pull/788

Uses --locked to ensure we only use deps from the lock file
Adds cooldown period to dependabot
pins actions versions
introduces zizimor and pinact

## 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
<!-- Remove any that are not relevant. -->
- [ ] 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.
- [ ] This PR was created by a human that thought critically about the
      proposed change and wrote an as clear and concise description as
      they could.
- [ ] This PR isn't slop, and is carefully crafted to do have the
      intented effect.
2026-08-21 10:24:02 +00:00

54 lines
1.4 KiB
YAML

# 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"
# Default to read-only; jobs that need more grant it explicitly.
permissions:
contents: read
jobs:
clean_docs_branch:
permissions:
contents: write # this job prunes the preview branch with a push
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: generated-docs-preview
# stays on: this job prunes the branch with a bare `git push`
persist-credentials: true
- name: Clean docs branch
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
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 diff --cached --quiet && echo "Nothing to clean up" && exit 0
git commit -m "Cleanup old docs"
git push