add support for the 'labeled' type

This commit is contained in:
Jacob Overgaard
2023-05-15 15:55:36 +02:00
parent 6ea93fd047
commit 1c75fe24ad

View File

@@ -5,7 +5,7 @@ on:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, closed]
types: [opened, synchronize, reopened, closed, labeled]
branches:
- main
@@ -14,7 +14,7 @@ env:
jobs:
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed' && contains(github.event.pull_request.labels, 'storybook'))
if: github.event_name == 'push' || (github.event_name == 'pull_request' && ((github.event.action == 'labeled' && github.event.label.name == 'storybook') || (github.event.action != 'closed' && contains(github.event.pull_request.labels.*.name, 'storybook'))))
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
@@ -37,7 +37,7 @@ jobs:
###### End of Repository/Build Configurations ######
close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed' && contains(github.event.pull_request.labels, 'storybook')
if: github.event_name == 'pull_request' && github.event.action == 'closed' && contains(github.event.pull_request.labels.*.name, 'storybook')
runs-on: ubuntu-latest
name: Close Pull Request Job
steps: