🔧(action) publish a comment when label preview is added

The label preview will deploy a full environment. This environment is
accessible using a specific url. This commit will publish a comment with
the good url.
This commit is contained in:
Nicolas Clerc
2026-08-14 17:34:09 +02:00
parent 0602c124a2
commit db2dfb556d
+27
View File
@@ -0,0 +1,27 @@
name: Label Preview
on:
pull_request:
types: [labeled, opened]
permissions:
pull-requests: write
jobs:
comment:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'preview')
steps:
- uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3
with:
message: |
:rocket: Preview will be available at [https://${{ github.event.pull_request.number }}-drive.ppr-fichiers.beta.numerique.gouv.fr/](https://${{ github.event.pull_request.number }}-drive.ppr-fichiers.beta.numerique.gouv.fr/)
You can use the existing account with these credentials:
- username: `drive`
- password: `drive`
You can also create a new account if you want to.
Once this Pull Request is merged, the preview will be destroyed.
comment-tag: preview-url