Skip to content

Commit cab8d46

Browse files
authored
Merge pull request #4 from code0-tech/comment-for-pipeline
Comment for pipeline
2 parents 254ae48 + 9a50101 commit cab8d46

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

.github/workflows/storybook.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,39 @@ on:
66
- main
77
pull_request:
88

9+
permissions:
10+
pull-requests: write
11+
912
jobs:
1013
storybook:
1114
runs-on: ubuntu-latest
1215
steps:
13-
- uses: Taucher2003/GitLab-Pipeline-Action@1.1.0
16+
- uses: Taucher2003/GitLab-Pipeline-Action@1.2.0
1417
name: Run pipeline
18+
id: pipeline
1519
with:
1620
GL_SERVER_URL: https://gitlab.com
1721
GL_PROJECT_ID: '52344025'
1822
GL_RUNNER_TOKEN: ${{ secrets.GL_RUNNER_TOKEN }}
1923
GL_API_TOKEN: ${{ secrets.GL_API_TOKEN }}
2024
SHOW_JOB_LOGS: all
25+
26+
- name: Find existing comment
27+
uses: peter-evans/find-comment@v2
28+
id: find-comment
29+
if: ${{ !cancelled() && github.event_name == 'pull_request' }}
30+
with:
31+
issue-number: ${{ github.event.pull_request.number }}
32+
comment-author: 'github-actions[bot]'
33+
body-includes: <!-- glpa_comment:storybook -->
34+
35+
- name: Create or update comment
36+
uses: peter-evans/create-or-update-comment@v3
37+
if: ${{ !cancelled() && github.event_name == 'pull_request' }}
38+
with:
39+
comment-id: ${{ steps.find-comment.outputs.comment-id }}
40+
issue-number: ${{ github.event.pull_request.number }}
41+
body: |
42+
<!-- glpa_comment:storybook -->
43+
${{ steps.pipeline.outputs.SUMMARY_TEXT }}
44+
edit-mode: replace

.gitlab-ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ storybook:build:
44
script:
55
- npm ci
66
- npm run storybook:build
7-
- echo "Storybook available at https://code0-tech.gitlab.io/-/base-ui/-/jobs/$CI_JOB_ID/artifacts/storybook-static/index.html"
7+
- |
8+
echo -e "\e[0Ksection_start:`date +%s`:glpa_summary\r\e[0KHeader of the summary"
9+
echo "Storybook available at https://code0-tech.gitlab.io/-/base-ui/-/jobs/$CI_JOB_ID/artifacts/storybook-static/index.html"
10+
echo -e "\e[0Ksection_end:`date +%s`:glpa_summary\r\e[0K"
811
environment:
912
name: storybook/$CI_COMMIT_REF_SLUG
1013
url: https://code0-tech.gitlab.io/-/base-ui/-/jobs/$CI_JOB_ID/artifacts/storybook-static/index.html

0 commit comments

Comments
 (0)