forked from OutSystems/docs-product
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (78 loc) · 2.7 KB
/
run.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Run
on:
workflow_dispatch:
push:
branches:
- master
- main
pull_request:
types: [opened, edited, synchronize, reopened, labeled, unlabeled]
concurrency:
group: run-${{ github.ref }}
cancel-in-progress: true
jobs:
pr-info:
name: Pull Request / Info
runs-on: ubuntu-latest
steps:
- name: Find Pull Request
if: github.ref_name != github.event.repository.default_branch
id: PR
uses: 8BitJonny/[email protected]
with:
filterOutClosed: true
sha: ${{ github.event.pull_request.head.sha }}
- name: 'Pull Request'
if: steps.PR.outputs.number != ''
run: |
echo "::notice title=Pull Request ${{ '#' }}${{ steps.PR.outputs.number }}::This workflow execution is related to the Pull Request https://github.com/${{ github.repository }}/pull/${{ steps.PR.outputs.number }}"
- name: Changed files
id: changed-files
if: github.ref_name != github.event.repository.default_branch && steps.PR.outputs.number != ''
run: |
echo "files<<EOF" >> $GITHUB_OUTPUT
gh pr diff ${{ steps.PR.outputs.number }} --repo ${{ github.repository }} --name-only >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
outputs:
changed-files: ${{ steps.changed-files.outputs.files }}
pull-request: ${{ steps.PR.outputs.number }}
pull-request-title: ${{ steps.PR.outputs.pr_title }}
skip-jira: ${{ github.ref_name != github.event.repository.default_branch && contains(steps.PR.outputs.pr_labels, 'skip-jira') }}
jira:
name: "JIRA"
needs: [pr-info]
if: needs.pr-info.outputs.pull-request != ''
uses: ./.github/workflows/jira-issue-pr.yml
secrets: inherit
with:
pull-request: ${{ needs.pr-info.outputs.pull-request }}
visual-assets:
name: "Visual Assets"
needs: [pr-info]
if: needs.pr-info.outputs.pull-request != ''
uses: ./.github/workflows/visual-assets-pr.yml
secrets: inherit
with:
pull-request: ${{ needs.pr-info.outputs.pull-request }}
files: ${{ needs.pr-info.outputs.changed-files }}
frontmatter:
name: Frontmatter
uses: ./.github/workflows/validate-frontmatter.yml
secrets: inherit
validations:
name: Misc validations
needs: frontmatter
if: needs.frontmatter.result == 'success'
uses: ./.github/workflows/validations.yml
secrets: inherit
with:
GITHUB_REPOSITORY: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }}
TK_CICD_BRANCH: 'main'
tools:
name: Tools
needs: [pr-info, frontmatter]
uses: ./.github/workflows/build.yml
secrets: inherit