|
| 1 | +name: Housekeeping |
| 2 | + |
| 3 | +on: |
| 4 | + issues: |
| 5 | + types: [opened] |
| 6 | + pull_request_target: |
| 7 | + types: [opened, ready_for_review] |
| 8 | + |
| 9 | +jobs: |
| 10 | + issue-management: |
| 11 | + if: ${{ github.event.issue }} |
| 12 | + name: Add issues to project and add triage label |
| 13 | + uses: rollkit/.github/.github/workflows/[email protected] |
| 14 | + secrets: inherit |
| 15 | + permissions: |
| 16 | + issues: write |
| 17 | + pull-requests: write |
| 18 | + with: |
| 19 | + run-labels: true |
| 20 | + labels-to-add: "needs-triage" |
| 21 | + run-projects: true |
| 22 | + project-url: https://github.com/orgs/rollkit/projects/7 |
| 23 | + |
| 24 | + add-pr-to-project: |
| 25 | + # ignore dependabot PRs |
| 26 | + if: ${{ github.event.pull_request && github.actor != 'dependabot[bot]' }} |
| 27 | + name: Add PRs to project |
| 28 | + uses: rollkit/.github/.github/workflows/[email protected] |
| 29 | + secrets: inherit |
| 30 | + permissions: |
| 31 | + issues: write |
| 32 | + pull-requests: write |
| 33 | + with: |
| 34 | + run-projects: true |
| 35 | + project-url: https://github.com/orgs/rollkit/projects/7 |
| 36 | + |
| 37 | + auto-add-reviewer: |
| 38 | + name: Auto add reviewer to PR |
| 39 | + if: github.event.pull_request |
| 40 | + uses: rollkit/.github/.github/workflows/[email protected] |
| 41 | + secrets: inherit |
| 42 | + permissions: |
| 43 | + issues: write |
| 44 | + pull-requests: write |
| 45 | + with: |
| 46 | + run-auto-request-review: true |
| 47 | + |
| 48 | + auto-add-assignee-pr: |
| 49 | + # ignore dependabot PRs |
| 50 | + if: ${{ github.event.pull_request && github.actor != 'dependabot[bot]' }} |
| 51 | + name: Assign PR to creator |
| 52 | + runs-on: ubuntu-latest |
| 53 | + permissions: |
| 54 | + issues: write |
| 55 | + pull-requests: write |
| 56 | + steps: |
| 57 | + - name: Set pull_request url and creator login |
| 58 | + # yamllint disable rule:line-length |
| 59 | + run: | |
| 60 | + echo "PR=${{ github.event.pull_request.html_url }}" >> $GITHUB_ENV |
| 61 | + echo "CREATOR=${{ github.event.pull_request.user.login }}" >> $GITHUB_ENV |
| 62 | + # yamllint enable rule:line-length |
| 63 | + - name: Assign PR to creator |
| 64 | + run: gh pr edit ${{ env.PR }} --add-assignee ${{ env.CREATOR }} |
| 65 | + env: |
| 66 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 67 | + |
| 68 | + auto-add-assignee-label: |
| 69 | + if: ${{ github.event.issue }} |
| 70 | + name: Assign issue to creator |
| 71 | + runs-on: ubuntu-latest |
| 72 | + permissions: |
| 73 | + issues: write |
| 74 | + pull-requests: write |
| 75 | + steps: |
| 76 | + - name: Checkout the repository |
| 77 | + uses: actions/checkout@v4 |
| 78 | + - name: Set issue number and creator login |
| 79 | + run: | |
| 80 | + echo "ISSUE=${{ github.event.issue.number }}" >> $GITHUB_ENV |
| 81 | + echo "CREATOR=${{ github.event.issue.user.login }}" >> $GITHUB_ENV |
| 82 | + - name: Assign issue to creator |
| 83 | + run: gh issue edit ${{ env.ISSUE }} --add-assignee ${{ env.CREATOR }} |
| 84 | + env: |
| 85 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments