diff --git a/.github/workflows/close_stale.yml b/.github/workflows/close_stale.yml index ed4a3393d..1c5105251 100644 --- a/.github/workflows/close_stale.yml +++ b/.github/workflows/close_stale.yml @@ -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: @@ -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 diff --git a/.github/workflows/delete-workflow-runs.yml b/.github/workflows/delete-workflow-runs.yml index e7582882d..6c8eb64c2 100644 --- a/.github/workflows/delete-workflow-runs.yml +++ b/.github/workflows/delete-workflow-runs.yml @@ -2,7 +2,7 @@ name: Delete workflow runs on: schedule: - - cron: '0 0 1 * *' + - cron: "0 1 * * *" workflow_dispatch: jobs: @@ -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: @@ -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 \ No newline at end of file diff --git a/.github/workflows/fork-sync.yml b/.github/workflows/fork-sync.yml index e66f1356d..2e8b23e86 100644 --- a/.github/workflows/fork-sync.yml +++ b/.github/workflows/fork-sync.yml @@ -2,10 +2,10 @@ name: Sync Fork on: schedule: - - cron: '*/30 * * * *' + - cron: "*/30 * * * *" workflow_dispatch: -concurrency: +concurrency: group: ${{ github.workflow }} jobs: @@ -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 @@ -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 diff --git a/.github/workflows/mirror-repo.yml b/.github/workflows/mirror-repo.yml index 026767ec6..aa3044991 100644 --- a/.github/workflows/mirror-repo.yml +++ b/.github/workflows/mirror-repo.yml @@ -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