Skip to content

Commit

Permalink
ci: fix the way to check labels before running unsafe workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
  • Loading branch information
Kenji Miyake committed Dec 14, 2021
1 parent aeb363a commit 5c61381
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/build-and-test-arm-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,24 @@ name: build-and-test-arm-pr

on:
pull_request:
types:
- opened
- synchronize
- labeled
workflow_dispatch:

jobs:
prevent-no-label-execution:
uses: autowarefoundation/autoware-github-actions/.github/workflows/prevent-no-label-execution.yaml@tier4/proposal
with:
label: ARM64

build-and-test-arm:
needs: prevent-no-label-execution
if: ${{ needs.prevent-no-label-execution.outputs.run == 'true' }}
runs-on: [self-hosted, linux, ARM64]
container: ros:galactic
steps:
- name: Check label
if: ${{ github.event.pull_request && !contains(github.event.pull_request.labels.*.name, 'ARM64') }}
run: |
echo "Please add a proper label to run this workflow."
exit 1
- name: Checkout repository
uses: actions/checkout@v2
with:
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,23 @@ on:
- "**/*.png"
- "**/*.jpg"
pull_request_target:
types:
- opened
- synchronize
- labeled
workflow_dispatch:

jobs:
prevent-no-label-execution:
uses: autowarefoundation/autoware-github-actions/.github/workflows/prevent-no-label-execution.yaml@tier4/proposal
with:
label: documentation

deploy-docs:
needs: prevent-no-label-execution
if: ${{ needs.prevent-no-label-execution.outputs.run == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Check label
if: ${{ github.event.pull_request && !contains(github.event.pull_request.labels.*.name, 'documentation') }}
run: |
echo "Please add a proper label to run this workflow."
exit 1
- name: Checkout repository
uses: actions/checkout@v2
with:
Expand Down

0 comments on commit 5c61381

Please sign in to comment.