forked from OutSystems/docs-product
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (55 loc) · 1.86 KB
/
visual-assets-pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Validate Visual Assets
on:
workflow_call:
inputs:
files:
description: "List of files to validate"
type: string
required: true
pull-request:
description: "The Pull Request number"
type: string
required: true
concurrency:
group: visual-assets-pr-${{ github.ref }}
cancel-in-progress: true
run-name: "Validate visual assets in ${{ github.ref_name }}"
jobs:
remove-visual-assets-comment:
name: Hide Comment
if: inputs.pull-request != ''
runs-on: ubuntu-latest
steps:
- name: 'Hide previous comments'
uses: marocchino/sticky-pull-request-comment@v2
with:
number: ${{ inputs.pull-request }}
header: VISUAL ASSETS VALIDATION
hide: true
hide_classify: "OUTDATED"
visual-assets:
name: Validate
needs: [remove-visual-assets-comment]
if: github.ref_name != github.event.repository.default_branch && inputs.pull-request != ''
uses: ./.github/workflows/visual-assets-validate.yml
secrets: inherit
with:
files: ${{ inputs.files }}
post-visual-assets-comment:
name: Add Comment
needs: [remove-visual-assets-comment, visual-assets]
if: always() && inputs.pull-request != '' && needs.visual-assets.outputs.report != ''
runs-on: ubuntu-latest
steps:
- name: 'Add report to Pull Request'
uses: marocchino/sticky-pull-request-comment@v2
with:
number: ${{ inputs.pull-request }}
header: VISUAL ASSETS VALIDATION
message: ${{ needs.visual-assets.outputs.report }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 'Visual assets validation failed'
uses: actions/github-script@v7
with:
script: |
core.error('Check Pull Request #${{ inputs.pull-request }} comments for detailed report on the issues related to visual assets.');