6211 Сухова ЮС Лаб.4 #443
Workflow file for this run
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: [closed] | |
| 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 6211 6212 6213 6214 | |
| 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: Remove PR Labels | |
| uses: actions-ecosystem/action-remove-labels@v1 | |
| with: | |
| labels: | | |
| In progress | |
| - name: Setting PR labels | |
| uses: actions-ecosystem/action-add-labels@v1 | |
| with: | |
| labels: | | |
| Done |