|
41 | 41 | run: | |
42 | 42 | echo "::error:: the test file contained granular file references" |
43 | 43 | exit 1 |
| 44 | + - name: verify lack of username |
| 45 | + continue-on-error: true |
| 46 | + run: | |
| 47 | + grep -q "@matfax" .github/CODEOWNERS.test |
| 48 | + echo "::set-env name=username::success" |
| 49 | + - name: fail if username is detected |
| 50 | + if: env.username == 'success' |
| 51 | + run: | |
| 52 | + echo "::error:: the generated file contained a username although the input was disabled" |
| 53 | + exit 1 |
| 54 | + |
| 55 | + with: |
| 56 | + name: ${{ github.job }}-owners |
| 57 | + path: .github/CODEOWNERS.test |
| 58 | + username: |
| 59 | + name: test with username |
| 60 | + runs-on: ubuntu-latest |
| 61 | + steps: |
| 62 | + - name: checkout code |
| 63 | + |
| 64 | + with: |
| 65 | + repository: ${{ github.event.pull_request.head.repo.full_name }} |
| 66 | + ref: ${{ github.head_ref }} |
| 67 | + fetch-depth: 0 |
| 68 | + - name: cache docker layers |
| 69 | + |
| 70 | + with: |
| 71 | + key: docker-layers-${{ hashFiles('Dockerfile') }}-${{ hashFiles('entrypoint.sh') }} |
| 72 | + - name: update code owners |
| 73 | + uses: ./ |
| 74 | + with: |
| 75 | + path: .github/CODEOWNERS.test |
| 76 | + username: true |
| 77 | + - name: verify contents of generated file (file) |
| 78 | + run: | |
| 79 | + grep -q "^/.gitignore @matfax$" .github/CODEOWNERS.test |
| 80 | + - name: verify contents of generated file (folder) |
| 81 | + run: | |
| 82 | + grep -q "^/.github/\* @matfax" .github/CODEOWNERS.test |
| 83 | + - name: verify lack of email address |
| 84 | + continue-on-error: true |
| 85 | + run: | |
| 86 | + grep -q "[email protected]" .github/CODEOWNERS.test |
| 87 | + echo "::set-env name=email::success" |
| 88 | + - name: fail if email is detected |
| 89 | + if: env.email == 'success' |
| 90 | + run: | |
| 91 | + echo "::error:: the generated file still contained an email address" |
| 92 | + exit 1 |
44 | 93 | |
45 | 94 | with: |
46 | 95 | name: ${{ github.job }}-owners |
|
0 commit comments