|
| 1 | +# Copyright 2023 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +name: security-center-snippets-v2 |
| 16 | +on: |
| 17 | + push: |
| 18 | + branches: |
| 19 | + - main |
| 20 | + paths: |
| 21 | + - 'security-center/snippets/v2/**' |
| 22 | + - '.github/workflows/security-center-snippets-v2.yaml' |
| 23 | + pull_request: |
| 24 | + paths: |
| 25 | + - 'security-center/snippets/v2/**' |
| 26 | + - '.github/workflows/security-center-snippets-v2.yaml' |
| 27 | + pull_request_target: |
| 28 | + types: [labeled] |
| 29 | + paths: |
| 30 | + - 'security-center/snippets/v2/**' |
| 31 | + - '.github/workflows/security-center-snippets-v2.yaml' |
| 32 | + schedule: |
| 33 | + - cron: '0 0 * * 0' |
| 34 | +jobs: |
| 35 | + test: |
| 36 | + # Ref: https://github.com/google-github-actions/auth#usage |
| 37 | + permissions: |
| 38 | + contents: 'read' |
| 39 | + id-token: 'write' |
| 40 | + if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run' |
| 41 | + uses: ./.github/workflows/test.yaml |
| 42 | + with: |
| 43 | + name: 'security-center-snippets-v2' |
| 44 | + path: 'security-center/snippets/v2' |
| 45 | + remove_label: |
| 46 | + # Ref: https://github.com/google-github-actions/auth#usage |
| 47 | + permissions: |
| 48 | + contents: 'read' |
| 49 | + id-token: 'write' |
| 50 | + if: | |
| 51 | + github.event.action == 'labeled' && |
| 52 | + github.event.label.name == 'actions:force-run' && |
| 53 | + always() |
| 54 | + uses: ./.github/workflows/remove-label.yaml |
| 55 | + flakybot: |
| 56 | + # Ref: https://github.com/google-github-actions/auth#usage |
| 57 | + permissions: |
| 58 | + contents: 'read' |
| 59 | + id-token: 'write' |
| 60 | + if: github.event_name == 'schedule' && always() # always() submits logs even if tests fail |
| 61 | + uses: ./.github/workflows/flakybot.yaml |
| 62 | + needs: [test] |
0 commit comments