Skip to content

Commit

Permalink
fix: fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
greenkiwi committed Sep 15, 2023
1 parent 8003b6c commit 6b95ba6
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions lint-release-notes/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ runs:
comment_id: ${{ steps.fc-release-notes.outputs.comment-id }}
token: ${{ inputs.github-token }}
- name: Comment release notes preview
id: release-notes-preview-comment
uses: peter-evans/create-or-update-comment@v1
if: steps.release-notes-preview.outputs.new-release-notes != '' && steps.find-pull-request.outputs.number != ''
with:
Expand Down Expand Up @@ -111,7 +112,8 @@ runs:
run: |
set -e
breaking_changes_file_missing=false
breaking_changes_file_default=false
breaking_changes_file_default_content=false
breaking_file_contents = ""
if [ "${{ steps.release-notes-preview.outputs.new-release-published }}" = "true" ]; then
echo "new release published"
if [ "${{ steps.release-notes-preview.outputs.new-release-type }}" = "major" ]; then
Expand All @@ -122,10 +124,11 @@ runs:
echo "breaking change doc $file_path exists."
expected_contents="Elaborate and add context to help the developer understand the changes"
breaking_file_contents=$(cat "$file_path")
if grep -Fq "$expected_contents" "$file_path"; then
echo "The file $file_path contains the expected contents."
else
echo "The file $file_path does not contain the expected contents."
echo "The file $file_path contains the default contents."
breaking_changes_file_default_content=false
fi
else
echo "breaking change doc $file_path does not exist."
Expand All @@ -136,6 +139,7 @@ runs:
echo "Output: required=${breaking_changes_file_missing}"
echo "required=${breaking_changes_file_missing}" >> $GITHUB_OUTPUT
echo "default_content=${breaking_changes_file_default_content}" >> $GITHUB_OUTPUT
echo "breaking_file_contents=${breaking_file_contents}" >> $GITHUB_OUTPUT
- name: Comment missing breaking changes doc
uses: peter-evans/create-or-update-comment@v1
if: steps.breaking-changes-file.outputs.required == 'true'
Expand Down Expand Up @@ -184,6 +188,15 @@ runs:
---
<!-- breaking changes comment -->
- name: Append breaking changes doc to release notes preview
uses: peter-evans/create-or-update-comment@v1
if: steps.breaking-changes-file.outputs.default_content != ''
with:
comment-id: ${{ steps.release-notes-preview-comment.outputs.comment-id }}
body: |
## Breaking changes documentation
${{ steps.breaking-changes-file.outputs.breaking_file_contents }}
- name: Fail if we are checking for the breaking changes doc and it is missing
if: steps.breaking-changes-file.outputs.required == 'true'
shell: bash
Expand Down

0 comments on commit 6b95ba6

Please sign in to comment.