CICD_examples
Форк от gitverse_tutorials/CICD_examples
23 строки · 863.0 Байт
1name: Демонстрация защиты ветки с использованием секрета
2on:
3pull_request:
4jobs:
5build-test:
6name: CICD branch protection with secrets
7runs-on: ubuntu-latest
8steps:
9- if: ${{ secrets.SECRET == 'TASK-' }}
10name: Check if secret is correct
11run: echo "true"
12- name: Display pull request title
13run: echo ${{ github.event.pull_request.title }}
14- name: Display commit message
15run: echo ${{ github.event.head_commit.message }}
16- name: Check pull request title
17run: |
18if [[ "${{ github.event.pull_request.title }}" > ${{ secrets.SECRET }} ]]; then
19echo "Pull request title contains SECRET with 'TASK-'"
20else
21echo "Pull request title does not contain SECRET with 'TASK-'"
22exit 1
23fi
24