|
| 1 | +name: PR Reopen Reassignment |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request_target: |
| 5 | + types: [reopened] |
| 6 | + issue_comment: |
| 7 | + types: [created] |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + issues: write |
| 12 | + pull-requests: read |
| 13 | + |
| 14 | +concurrency: |
| 15 | + group: bot-autoassign-pr-reopen-${{ github.repository }}-${{ github.event.pull_request.number || github.event.issue.number }} |
| 16 | + cancel-in-progress: true |
| 17 | + |
| 18 | +jobs: |
| 19 | + reassign-on-reopen: |
| 20 | + runs-on: ubuntu-latest |
| 21 | + if: github.event_name == 'pull_request_target' && github.event.action == 'reopened' |
| 22 | + steps: |
| 23 | + - name: Generate GitHub App token |
| 24 | + id: generate-token |
| 25 | + uses: actions/create-github-app-token@v2 |
| 26 | + with: |
| 27 | + app-id: ${{ secrets.OPENWISP_BOT_APP_ID }} |
| 28 | + private-key: ${{ secrets.OPENWISP_BOT_PRIVATE_KEY }} |
| 29 | + |
| 30 | + - name: Checkout openwisp-utils |
| 31 | + uses: actions/checkout@v6 |
| 32 | + with: |
| 33 | + repository: openwisp/openwisp-utils |
| 34 | + ref: master |
| 35 | + path: openwisp-utils |
| 36 | + |
| 37 | + - name: Set up Python |
| 38 | + uses: actions/setup-python@v6 |
| 39 | + with: |
| 40 | + python-version: "3.13" |
| 41 | + |
| 42 | + - name: Install dependencies |
| 43 | + run: pip install -e openwisp-utils/.[github_actions] |
| 44 | + |
| 45 | + - name: Reassign issues on PR reopen |
| 46 | + env: |
| 47 | + GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} |
| 48 | + REPOSITORY: ${{ github.repository }} |
| 49 | + GITHUB_EVENT_NAME: ${{ github.event_name }} |
| 50 | + run: > |
| 51 | + python openwisp-utils/.github/actions/bot-autoassign/__main__.py |
| 52 | + pr_reopen "$GITHUB_EVENT_PATH" |
| 53 | +
|
| 54 | + handle-pr-activity: |
| 55 | + runs-on: ubuntu-latest |
| 56 | + if: github.event_name == 'issue_comment' && github.event.issue.pull_request |
| 57 | + steps: |
| 58 | + - name: Generate GitHub App token |
| 59 | + id: generate-token |
| 60 | + uses: actions/create-github-app-token@v2 |
| 61 | + with: |
| 62 | + app-id: ${{ secrets.OPENWISP_BOT_APP_ID }} |
| 63 | + private-key: ${{ secrets.OPENWISP_BOT_PRIVATE_KEY }} |
| 64 | + |
| 65 | + - name: Checkout openwisp-utils |
| 66 | + uses: actions/checkout@v6 |
| 67 | + with: |
| 68 | + repository: openwisp/openwisp-utils |
| 69 | + ref: master |
| 70 | + path: openwisp-utils |
| 71 | + |
| 72 | + - name: Set up Python |
| 73 | + uses: actions/setup-python@v6 |
| 74 | + with: |
| 75 | + python-version: "3.13" |
| 76 | + |
| 77 | + - name: Install dependencies |
| 78 | + run: pip install -e openwisp-utils/.[github_actions] |
| 79 | + |
| 80 | + - name: Handle PR activity |
| 81 | + env: |
| 82 | + GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} |
| 83 | + REPOSITORY: ${{ github.repository }} |
| 84 | + GITHUB_EVENT_NAME: ${{ github.event_name }} |
| 85 | + run: > |
| 86 | + python openwisp-utils/.github/actions/bot-autoassign/__main__.py |
| 87 | + pr_reopen "$GITHUB_EVENT_PATH" |
0 commit comments