mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-27 02:37:53 +00:00
The closed issue & PR lock is working fine, but it has a built-in 50-item limit. The limit is not configurable. Since there are tens-of-thousands of issues/prs to go through, 50-per-day could take almost a year. Speed things up 24x by running the job every hour instead of daily. Signed-off-by: Chris Evich <cevich@redhat.com>
73 lines
2.4 KiB
YAML
73 lines
2.4 KiB
YAML
---
|
|
|
|
# Format ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
|
|
|
|
name: "Lock closed Issue/PR discussions"
|
|
|
|
on:
|
|
schedule:
|
|
# TODO: Put this back to once-per-day after the workflow is able
|
|
# to process through the enormous backlog. Leaving it once-per-hour
|
|
# runs the risk of spamming podman-monitor should there be some flake
|
|
# or hiccup.
|
|
# - cron: '0 0 * * *'
|
|
- cron: '0 * * * *'
|
|
# Allow re-use of this workflow by other repositories
|
|
# Ref: https://docs.github.com/en/actions/using-workflows/reusing-workflows
|
|
workflow_call:
|
|
secrets:
|
|
ACTION_MAIL_SERVER:
|
|
required: true
|
|
ACTION_MAIL_USERNAME:
|
|
required: true
|
|
ACTION_MAIL_PASSWORD:
|
|
required: true
|
|
ACTION_MAIL_SENDER:
|
|
required: true
|
|
# Debug: Allow triggering job manually in github-actions WebUI
|
|
workflow_dispatch: {}
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: lock
|
|
|
|
env:
|
|
# Number of days before a closed issue/PR is be comment-locked.
|
|
# Note: dessant/lock-threads will only process a max. of
|
|
# 50 issues/PRs at a time.
|
|
CLOSED_DAYS: 90
|
|
# Pre-created issue/PR label to add (preferably a bright color).
|
|
# This is intended to direct a would-be commenter's actions.
|
|
LOCKED_LABEL: 'locked - please file new issue/PR'
|
|
|
|
jobs:
|
|
closed_issue_discussion_lock:
|
|
name: "Lock closed Issue/PR discussions"
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
issues: write
|
|
pull-requests: write
|
|
steps:
|
|
# Ref: https://github.com/dessant/lock-threads#usage
|
|
- uses: dessant/lock-threads@v4
|
|
with:
|
|
issue-inactive-days: '${{env.CLOSED_DAYS}}'
|
|
pr-inactive-days: '${{env.CLOSED_DAYS}}'
|
|
add-issue-labels: '${{env.LOCKED_LABEL}}'
|
|
add-pr-labels: '${{env.LOCKED_LABEL}}'
|
|
pr-lock-reason: 'resolved'
|
|
log-output: true
|
|
- if: failure()
|
|
name: Send job failure notification e-mail
|
|
uses: dawidd6/action-send-mail@v3.8.0
|
|
with:
|
|
server_address: ${{secrets.ACTION_MAIL_SERVER}}
|
|
server_port: 465
|
|
username: ${{secrets.ACTION_MAIL_USERNAME}}
|
|
password: ${{secrets.ACTION_MAIL_PASSWORD}}
|
|
subject: Github workflow error on ${{github.repository}}
|
|
to: podman-monitor@lists.podman.io
|
|
from: ${{secrets.ACTION_MAIL_SENDER}}
|
|
body: "Job failed: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
|