Маринин Андрей Лаб. 2 Группа 6511 #85
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: Setup PR for code review | |
| on: | |
| pull_request_target: | |
| types: [opened, reopened] | |
| permissions: write-all | |
| jobs: | |
| assign: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Parsing your PR title for lab number | |
| env: | |
| TITLE: ${{ github.event.pull_request.title }} | |
| run: | | |
| SUB='Лаб.' | |
| for VAR in 1 2 3 4 | |
| do | |
| if (echo $TITLE | grep -iqF "$SUB$VAR" )|| (echo $TITLE | grep -iqF "$SUB $VAR"); then | |
| echo "LABEL=Lab $VAR" >> "$GITHUB_ENV" | |
| break | |
| fi | |
| done | |
| for VAR in 6511 6512 6513 | |
| do | |
| if (echo $TITLE | grep -iqF "$VAR" ); then | |
| echo "GROUP=$VAR" >> "$GITHUB_ENV" | |
| break | |
| fi | |
| done | |
| - name: Checking your lab number | |
| run: | | |
| if [[ $LABEL == '' ]]; then | |
| echo "Your PR caption is not composed correctly" | |
| exit 1 | |
| fi | |
| echo Your number was parsed correctly - ${{ env.LABEL }} | |
| - name: Checking your group number | |
| run: | | |
| if [[ $GROUP == '' ]]; then | |
| echo "Your PR caption is not composed correctly" | |
| exit 1 | |
| fi | |
| echo Your group was parsed correctly - ${{ env.GROUP }} | |
| - name: Setting PR labels | |
| uses: actions-ecosystem/action-add-labels@v1 | |
| with: | |
| labels: | | |
| ${{ env.LABEL }} | |
| In progress | |
| - name: Setting reviewer | |
| if: env.GROUP == '6511' | |
| uses: AveryCameronUofR/add-reviewer-gh-action@1.0.3 | |
| with: | |
| reviewers: "danlla" | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setting reviewer | |
| if: env.GROUP == '6512' | |
| uses: AveryCameronUofR/add-reviewer-gh-action@1.0.3 | |
| with: | |
| reviewers: "Gwymlas" | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setting reviewer | |
| if: env.GROUP == '6513' | |
| uses: AveryCameronUofR/add-reviewer-gh-action@1.0.3 | |
| with: | |
| reviewers: "alxmcs" | |
| token: ${{ secrets.GITHUB_TOKEN }} |