Skip to content

Commit

Permalink
Bugfix/readme (0xERR0R#1232)
Browse files Browse the repository at this point in the history
* delete old runs of frequently run workflows

* run cleanup every day
  • Loading branch information
kwitsch authored Nov 12, 2023
1 parent 8ece708 commit dc66eff
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 20 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/close_stale.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'Close stale issues and PRs'
name: "Close stale issues and PRs"
on:
schedule:
- cron: '0 4 * * *'
- cron: "0 4 * * *"

jobs:
stale:
Expand All @@ -13,13 +13,20 @@ jobs:
steps:
- uses: actions/stale@v8
with:
stale-issue-message: 'This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
stale-pr-message: 'This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.'
close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.'
close-pr-message: 'This PR was closed because it has been stalled for 10 days with no activity.'
stale-issue-message: "This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days."
stale-pr-message: "This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days."
close-issue-message: "This issue was closed because it has been stalled for 5 days with no activity."
close-pr-message: "This PR was closed because it has been stalled for 10 days with no activity."
days-before-issue-stale: 90
days-before-pr-stale: 45
days-before-issue-close: 5
days-before-pr-close: 10
exempt-all-milestones: true
operations-per-run: 60

- name: Delete old runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
delete_workflow_pattern: close_stale.yml
12 changes: 2 additions & 10 deletions .github/workflows/delete-workflow-runs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Delete workflow runs

on:
schedule:
- cron: '0 0 1 * *'
- cron: "0 1 * * *"
workflow_dispatch:

jobs:
Expand All @@ -18,7 +18,7 @@ jobs:
retain_days: 0
keep_minimum_runs: 0
delete_run_by_conclusion_pattern: skipped

- name: Delete cancelled
uses: Mattraks/delete-workflow-runs@v2
with:
Expand All @@ -27,11 +27,3 @@ jobs:
retain_days: 0
keep_minimum_runs: 0
delete_run_by_conclusion_pattern: cancelled

- name: Delete workflow runs(older than a month)
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 30
keep_minimum_runs: 6
16 changes: 12 additions & 4 deletions .github/workflows/fork-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Sync Fork

on:
schedule:
- cron: '*/30 * * * *'
- cron: "*/30 * * * *"
workflow_dispatch:

concurrency:
concurrency:
group: ${{ github.workflow }}

jobs:
Expand All @@ -17,7 +17,7 @@ jobs:
- name: Enabled Check
id: check
shell: bash
run: |
run: |
if [[ "${{ secrets.FORK_SYNC_TOKEN }}" != "" ]]; then
echo "enabled=1" >> $GITHUB_OUTPUT
Expand All @@ -27,10 +27,18 @@ jobs:
echo "Workflow is disabled(create FORK_SYNC_TOKEN secret with repo write permission to enable it)"
fi
- name: Sync
if: ${{ steps.check.outputs.enabled == 1 }}
env:
GH_TOKEN: ${{ secrets.FORK_SYNC_TOKEN }}
shell: bash
run: |
run: |
gh repo sync ${{ github.repository }} -b main
- name: Delete old runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
delete_workflow_pattern: fork-sync.yml
8 changes: 8 additions & 0 deletions .github/workflows/mirror-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,16 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: yesolutions/mirror-action@master
with:
REMOTE: 'https://codeberg.org/0xERR0R/blocky.git'
GIT_USERNAME: 0xERR0R
GIT_PASSWORD: ${{ secrets.CODEBERG_TOKEN }}

- name: Delete old runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
delete_workflow_pattern: mirror-repo.yml

0 comments on commit dc66eff

Please sign in to comment.