-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (79 loc) · 2.74 KB
/
pr-validate.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
90
91
92
name: PR Validate
on:
pull_request:
types: [edited, opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-edit-${{ github.event.number }}
cancel-in-progress: true
jobs:
vars:
name: Variables
runs-on: ubuntu-22.04
outputs:
url: ${{ steps.calculate.outputs.url }}
steps:
- name: Calculate the deployment number
id: calculate
run: echo "url=$((${{ github.event.number }} % 50))" >> $GITHUB_OUTPUT
validate:
name: Validate PR
needs: [vars]
uses: bcgov/quickstart-openshift-helpers/.github/workflows/.pr-validate.yml@v0.4.0
with:
markdown_links: |
Any successful deployments (not always required) will be available [here](https://${{ github.event.repository.name }}-${{ needs.vars.outputs.url }}-frontend.apps.silver.devops.gov.bc.ca/)
changelog:
name: Pull Request Validation
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Pull request size and stability labels
uses: actions/labeler@v5
continue-on-error: true
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Conventional Label
uses: bcoe/conventional-release-labels@v1
continue-on-error: true
with:
token: ${{ secrets.GITHUB_TOKEN }}
ignored_types: '["chore","pr"]'
type_labels: '{"feat": "feature", "fix": "fix", "bug": "fix", "doc": "documentation", "ci": "ci", "chore": "chore", "breaking": "breaking", "BREAKING CHANGE": "breaking"}'
- name: Checkout branch
uses: actions/checkout@v4
with:
ref: refs/heads/${{ github.head_ref }}
- name: Conventional Changelog Update
id: changelog
continue-on-error: true
uses: TriPSs/conventional-changelog-action@v5
with:
github-token: ${{ github.token }}
output-file: "CHANGELOG.md"
skip-version-file: "true"
skip-commit: "true"
git-push: "false"
git-branch: refs/heads/${{ github.head_ref }}
- name: Checkout pr
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Comment PR
continue-on-error: true
uses: thollander/actions-comment-pull-request@v2
if: ${{ steps.changelog.outputs.skipped == 'false' }}
with:
message: |
# Current changelog
${{ steps.changelog.outputs.clean_changelog }}
comment_tag: "# Current changelog"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
results:
name: Validate Results
needs: [changelog, validate]
runs-on: ubuntu-22.04
steps:
- run: echo "Workflow completed successfully!"