0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

ci: trigger CI via comment and label (#11849)

* ci: trigger CI via comment and label

* fix: reduce parenthesis
This commit is contained in:
Emanuele Stoppa 2024-08-27 14:59:07 +01:00 committed by GitHub
parent 0a92f1a3da
commit 543e8f5b78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 8 deletions

19
.github/workflows/preview-comment.yml vendored Normal file
View file

@ -0,0 +1,19 @@
name: Add continuous release label
on:
issue_comment:
types: [created]
permissions:
pull-requests: write
jobs:
label:
if: ${{ github.repository_owner == 'withastro' && startsWith(github.event.comment.body, '!preview') }}
runs-on: ubuntu-latest
steps:
- run: |
gh issue edit ${{ github.event.issue.number }} --add-label "pr: preview" --repo ${{ github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -1,18 +1,18 @@
name: Preview release
on:
workflow_dispatch:
issue_comment:
types: [created]
pull_request:
branches: [main]
types: [opened, synchronize, labeled, ready_for_review]
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}
cancel-in-progress: true
permissions:
contents: read
actions: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
@ -24,7 +24,8 @@ env:
jobs:
preview:
if: ${{ github.repository_owner == 'withastro' && github.event.issue.pull_request && (startsWith(github.event.comment.body, '!preview')) }}
if: |
${{ github.repository_owner == 'withastro' && github.event.issue.pull_request && contains(github.event.pull_request.labels.*.name, 'pr: preview') }}
runs-on: ubuntu-latest
permissions:
contents: read