summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Emanuele Stoppa <my.burning@gmail.com> 2024-08-27 14:59:07 +0100
committerGravatar GitHub <noreply@github.com> 2024-08-27 14:59:07 +0100
commit543e8f5b78035b8457445845dd5fcfe323f107db (patch)
tree230a01741f97a25279ece807f4c2c64a8be4d59c
parent0a92f1a3dacc52df7bf3a9219ada82a34ef77e8f (diff)
downloadastro-543e8f5b78035b8457445845dd5fcfe323f107db.tar.gz
astro-543e8f5b78035b8457445845dd5fcfe323f107db.tar.zst
astro-543e8f5b78035b8457445845dd5fcfe323f107db.zip
ci: trigger CI via comment and label (#11849)
* ci: trigger CI via comment and label * fix: reduce parenthesis
-rw-r--r--.github/workflows/preview-comment.yml19
-rw-r--r--.github/workflows/preview-release.yml17
2 files changed, 28 insertions, 8 deletions
diff --git a/.github/workflows/preview-comment.yml b/.github/workflows/preview-comment.yml
new file mode 100644
index 000000000..7ed6bdf6f
--- /dev/null
+++ b/.github/workflows/preview-comment.yml
@@ -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 }}
diff --git a/.github/workflows/preview-release.yml b/.github/workflows/preview-release.yml
index 225efe402..df6a44f48 100644
--- a/.github/workflows/preview-release.yml
+++ b/.github/workflows/preview-release.yml
@@ -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