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:
parent
0a92f1a3da
commit
543e8f5b78
2 changed files with 28 additions and 8 deletions
19
.github/workflows/preview-comment.yml
vendored
Normal file
19
.github/workflows/preview-comment.yml
vendored
Normal 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 }}
|
17
.github/workflows/preview-release.yml
vendored
17
.github/workflows/preview-release.yml
vendored
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue