|
| 1 | +name: Assign to someone |
| 2 | +on: |
| 3 | + issues: |
| 4 | + types: [opened] |
| 5 | +jobs: |
| 6 | + assignIssue: |
| 7 | + name: Assign Issue to Someone |
| 8 | + runs-on: ubuntu-latest |
| 9 | + if: github.repository == 'microsoft/vscode-jupyter' |
| 10 | + steps: |
| 11 | + - name: Should we proceed |
| 12 | + id: proceed |
| 13 | + env: |
| 14 | + ISSUE_ASSIGNEES: ${{toJson(github.event.issue.assignees)}} |
| 15 | + run: | |
| 16 | + echo ::set-output name=result::$(node -p -e "JSON.parse(process.env.ISSUE_ASSIGNEES).length === 0 ? 1 : 0") |
| 17 | + shell: bash |
| 18 | + - uses: actions/checkout@v2 |
| 19 | + if: steps.proceed.outputs.result == 1 |
| 20 | + - name: Day of week |
| 21 | + if: steps.proceed.outputs.result == 1 |
| 22 | + id: day |
| 23 | + run: | |
| 24 | + echo ::set-output name=number::$(node -p -e "new Date().getDay()") |
| 25 | + shell: bash |
| 26 | + - name: Hour of day |
| 27 | + if: steps.proceed.outputs.result == 1 |
| 28 | + id: hour |
| 29 | + run: | |
| 30 | + echo ::set-output name=hour::$(node -p -e "(new Date().getUTCHours() - 7)%24") |
| 31 | + shell: bash |
| 32 | + - name: Week Number |
| 33 | + if: steps.proceed.outputs.result == 1 |
| 34 | + id: week |
| 35 | + run: | |
| 36 | + echo ::set-output name=odd::$(node .github/workflows/week.js) |
| 37 | + shell: bash |
| 38 | + - name: Print day and week |
| 39 | + if: steps.proceed.outputs.result == 1 |
| 40 | + run: | |
| 41 | + echo ${{steps.day.outputs.number}} |
| 42 | + echo ${{steps.week.outputs.odd}} |
| 43 | + echo ${{steps.hour.outputs.hour}} |
| 44 | + shell: bash |
| 45 | + - name: Even late friday (David) |
| 46 | + if: steps.proceed.outputs.result == 1 && steps.week.outputs.odd == 0 && steps.day.outputs.number == 5 && steps.hour.outputs.hour >= 16 |
| 47 | + |
| 48 | + env: |
| 49 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 50 | + with: |
| 51 | + args: assign DavidKutu |
| 52 | + - name: Odd late friday (Joyce) |
| 53 | + if: steps.proceed.outputs.result == 1 && steps.week.outputs.odd == 1 && steps.day.outputs.number == 5 && steps.hour.outputs.hour >= 16 |
| 54 | + |
| 55 | + env: |
| 56 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 57 | + with: |
| 58 | + args: assign joyceerhl |
| 59 | + - name: Odd weekends (David) |
| 60 | + if: steps.proceed.outputs.result == 1 && steps.week.outputs.odd == 1 && (steps.day.outputs.number == 6 || steps.day.outputs.number == 0) |
| 61 | + |
| 62 | + env: |
| 63 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 64 | + with: |
| 65 | + args: assign DavidKutu |
| 66 | + - name: Even weekends (Joyce) |
| 67 | + if: steps.proceed.outputs.result == 1 && steps.week.outputs.odd == 0 && (steps.day.outputs.number == 6 || steps.day.outputs.number == 0) |
| 68 | + |
| 69 | + env: |
| 70 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 71 | + with: |
| 72 | + args: assign joyceerhl |
| 73 | + - name: Odd Monday (David) |
| 74 | + if: steps.proceed.outputs.result == 1 && steps.week.outputs.odd == 1 && steps.day.outputs.number == 1 && steps.hour.outputs.hour < 16 |
| 75 | + |
| 76 | + env: |
| 77 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 78 | + with: |
| 79 | + args: assign DavidKutu |
| 80 | + - name: Even Monday (Joyce) |
| 81 | + if: steps.proceed.outputs.result == 1 && steps.week.outputs.odd == 0 && steps.day.outputs.number == 1 && steps.hour.outputs.hour < 16 |
| 82 | + |
| 83 | + env: |
| 84 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 85 | + with: |
| 86 | + args: assign joyceerhl |
| 87 | + - name: Tuesday (Ian) |
| 88 | + if: steps.proceed.outputs.result == 1 && (steps.day.outputs.number == 1 && steps.hour.outputs.hour >= 16) || (steps.day.outputs.number == 2 && steps.hour.outputs.hour < 16) |
| 89 | + |
| 90 | + env: |
| 91 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 92 | + with: |
| 93 | + args: assign IanMatthewHuff |
| 94 | + - name: Wednesday (Rich) |
| 95 | + if: steps.proceed.outputs.result == 1 && (steps.day.outputs.number == 2 && steps.hour.outputs.hour >= 16) || (steps.day.outputs.number == 3 && steps.hour.outputs.hour < 16) |
| 96 | + |
| 97 | + env: |
| 98 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 99 | + with: |
| 100 | + args: assign rchiodo |
| 101 | + - name: Thursday (Don) |
| 102 | + if: steps.proceed.outputs.result == 1 && (steps.day.outputs.number == 3 && steps.hour.outputs.hour >= 16) || (steps.day.outputs.number == 4 && steps.hour.outputs.hour < 16) |
| 103 | + |
| 104 | + env: |
| 105 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 106 | + with: |
| 107 | + args: assign DonJayamanne |
| 108 | + - name: Friday (Claudia) |
| 109 | + if: steps.proceed.outputs.result == 1 && (steps.day.outputs.number == 4 && steps.hour.outputs.hour >= 16) || (steps.day.outputs.number == 5 && steps.hour.outputs.hour < 16) |
| 110 | + |
| 111 | + env: |
| 112 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 113 | + with: |
| 114 | + args: assign claudiaregio |
0 commit comments