Redmine Upkeep #3462
This file contains hidden or 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
| --- | |
| name: Redmine Upkeep | |
| on: | |
| # To manually trigger this: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch | |
| # View past runs and output: https://github.com/ceph/ceph/actions/workflows/create-backport-trackers.yml | |
| workflow_dispatch: | |
| inputs: | |
| issue: | |
| description: 'issue to update' | |
| type: string | |
| default: '' | |
| limit: | |
| description: '--limit: limit issue traversal' | |
| default: 50 | |
| type: int | |
| debug: | |
| description: '--debug: Show debug-level messages' | |
| default: false | |
| type: boolean | |
| schedule: | |
| - cron: '0 */12 * * *' | |
| pull_request_target: | |
| types: [closed] | |
| branches: | |
| - main | |
| # TODO enable/setup after upkeep has caught up | |
| # push: | |
| # tags: | |
| # - 'v*' | |
| # for testing | |
| push: | |
| branches: | |
| - 'feature/redmine-upkeep' | |
| jobs: | |
| redmine-upkeep: | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'ceph/ceph' | |
| steps: | |
| - name: Checkout main branch for pull_request_target | |
| if: github.event_name == 'pull_request_target' | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| ref: 'refs/heads/main' | |
| path: 'ceph' | |
| fetch-depth: 0 | |
| - name: Checkout default branch for other events | |
| if: github.event_name != 'pull_request_target' | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| path: 'ceph' | |
| fetch-depth: 0 | |
| - name: Setup Python | |
| uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 | |
| with: | |
| python-version: '3.9' | |
| cache: 'pip' | |
| cache-dependency-path: ceph/src/script/requirements.redmine-upkeep.txt | |
| - name: Install dependencies | |
| run: pip install -r ceph/src/script/requirements.redmine-upkeep.txt | |
| - name: Run redmine-upkeep via workflow_dispatch | |
| if: github.event_name == 'workflow_dispatch' | |
| run: > | |
| python3 ceph/src/script/redmine-upkeep.py | |
| --github-action | |
| --git-dir=./ceph/ | |
| (inputs.debug && '--debug' || '') | |
| format('--limit={0}', inputs.limit) | |
| env: | |
| REDMINE_API_KEY: ${{ secrets.REDMINE_API_KEY_BACKPORT_BOT }} | |
| - name: Run redmine-upkeep via schedule | |
| if: github.event_name == 'schedule' | |
| run: > | |
| python3 ceph/src/script/redmine-upkeep.py | |
| --github-action | |
| --git-dir=./ceph/ | |
| --limit=5000 | |
| env: | |
| REDMINE_API_KEY: ${{ secrets.REDMINE_API_KEY_BACKPORT_BOT }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run redmine-upkeep via test push | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/feature/redmine-upkeep' | |
| run: > | |
| python3 ceph/src/script/redmine-upkeep.py | |
| --github-action | |
| --git-dir=./ceph/ | |
| --limit=50 | |
| env: | |
| REDMINE_API_KEY: ${{ secrets.REDMINE_API_KEY_BACKPORT_BOT }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run redmine-upkeep via merge on pull_request_target | |
| if: github.event_name == 'pull_request_target' && github.event.pull_request.merged == true | |
| run: > | |
| python3 ceph/src/script/redmine-upkeep.py | |
| --github-action | |
| --git-dir=./ceph/ | |
| --pull-request=${{ github.event.pull_request.number }} | |
| --merge-commit=${{ github.event.pull_request.merge_commit_sha }} | |
| env: | |
| REDMINE_API_KEY: ${{ secrets.REDMINE_API_KEY_BACKPORT_BOT }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |