-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
51 lines (43 loc) · 1.74 KB
/
action.yml
File metadata and controls
51 lines (43 loc) · 1.74 KB
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
# SPDX-FileCopyrightText: Copyright (c) CloudZero, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
name: CloudZero Changelog Release Notes Action
description: GitHub Action to validate release notes for a given version
author: Cloudzero
branding:
icon: chevron-up
color: purple
inputs:
releaseNotesDirectory:
description: "The path to the release notes directory"
default: ${{ github.workspace }}/docs/releases
version:
description: "The version to validate"
required: true
outputs:
releaseNotesFile:
description: "The path to the release notes file"
value: "${{ steps.set-path.outputs.file_path }}"
runs:
using: "composite"
steps:
- uses: actions/checkout@v4
- name: Set Release Notes Path
id: set-path
shell: bash
run: |
FILE_PATH="${{ inputs.releaseNotesDirectory }}/${{ inputs.version }}.md"
echo "file_path=$FILE_PATH" >> $GITHUB_OUTPUT
- name: Validate Release Notes are Present
shell: bash
run: |
if [ ! -f "${{ steps.set-path.outputs.file_path }}" ]; then
echo "Release notes for ${{ inputs.version }} are missing. Please create a release notes file at ${{ steps.set-path.outputs.file_path }}"
exit 1
fi
- name: Validate Formatting
shell: bash
run: |
if ! grep -q "^# \[${{ inputs.version }}\](https://github.com/${{ github.repository }}/compare/.*) ([0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\})" ${{ steps.set-path.outputs.file_path }}; then
echo "Error: Version ${{ inputs.version }} does not have the correct title format \"# [${{ inputs.version }}](https://github.com/${{ github.repository }}/compare/) - YYYY-MM-DD\""
exit 1
fi