From 83bb098888a3872c847cb63c2bb369401d05d973 Mon Sep 17 00:00:00 2001 From: guyrenny Date: Tue, 1 Aug 2023 11:46:19 +0300 Subject: [PATCH] Create new action changelog and add changelog file to the integrations Signed-off-by: guyrenny --- .github/pull_request_template.md | 0 .github/workflows/Changelog.yaml | 42 +++++++++++++++++++ .github/workflows/Synchronizing.yml | 29 ++++++++----- scripts/changelog_check.sh | 11 +++++ .../replace_codeuri.sh | 0 src/archive-reader/CHANGELOG.md | 6 +++ src/athena-s3/CHANGELOG.md | 6 +++ src/cloudtrail-sns/CHANGELOG.md | 6 +++ src/cloudtrail/CHANGELOG.md | 6 +++ src/cloudwatch-logs/CHANGELOG.md | 6 +++ src/cloudwatch-metrics/CHANGELOG.md | 6 +++ src/ecr/CHANGELOG.md | 6 +++ src/elasticsearch-reporter/CHANGELOG.md | 6 +++ src/kafka/CHANGELOG.md | 6 +++ src/kinesis/CHANGELOG.md | 6 +++ src/lambda-extension/CHANGELOG.md | 6 +++ src/lambda-manager/CHANGELOG.md | 6 +++ src/lambda-secretLayer/CHANGELOG.md | 6 +++ src/msk/CHANGELOG.md | 6 +++ src/resource-metadata/CHANGELOG.md | 6 +++ src/resource-tags/CHANGELOG.md | 6 +++ src/s3-sns/CHANGELOG.md | 6 +++ src/s3/CHANGELOG.md | 6 +++ src/sf-eventlog/CHANGELOG.md | 6 +++ src/sns/CHANGELOG.md | 6 +++ src/vpc-flow-logs/CHANGELOG.md | 6 +++ 26 files changed, 198 insertions(+), 10 deletions(-) create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/Changelog.yaml create mode 100644 scripts/changelog_check.sh rename replace_codeuri.sh => scripts/replace_codeuri.sh (100%) create mode 100644 src/archive-reader/CHANGELOG.md create mode 100644 src/athena-s3/CHANGELOG.md create mode 100644 src/cloudtrail-sns/CHANGELOG.md create mode 100644 src/cloudtrail/CHANGELOG.md create mode 100644 src/cloudwatch-logs/CHANGELOG.md create mode 100644 src/cloudwatch-metrics/CHANGELOG.md create mode 100644 src/ecr/CHANGELOG.md create mode 100644 src/elasticsearch-reporter/CHANGELOG.md create mode 100644 src/kafka/CHANGELOG.md create mode 100644 src/kinesis/CHANGELOG.md create mode 100644 src/lambda-extension/CHANGELOG.md create mode 100644 src/lambda-manager/CHANGELOG.md create mode 100644 src/lambda-secretLayer/CHANGELOG.md create mode 100644 src/msk/CHANGELOG.md create mode 100644 src/resource-metadata/CHANGELOG.md create mode 100644 src/resource-tags/CHANGELOG.md create mode 100644 src/s3-sns/CHANGELOG.md create mode 100644 src/s3/CHANGELOG.md create mode 100644 src/sf-eventlog/CHANGELOG.md create mode 100644 src/sns/CHANGELOG.md create mode 100644 src/vpc-flow-logs/CHANGELOG.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..e69de29b diff --git a/.github/workflows/Changelog.yaml b/.github/workflows/Changelog.yaml new file mode 100644 index 00000000..1e9d8e95 --- /dev/null +++ b/.github/workflows/Changelog.yaml @@ -0,0 +1,42 @@ +name: Changelog +on: + pull_request: + types: [opened, synchronize] + branches: [master] + paths: + - "src/**" + +jobs: + get-label: + runs-on: ubuntu-latest + name: get label + outputs: + labels: "${{ steps.pr-labels.outputs.labels }}" + steps: + - name: Get PR labels + id: pr-labels + uses: joerick/pr-labels-action@v1.0.8 + + check-changelog-updates: + if: "${{ needs.get-label.outputs.labels != ' skip-changelog ' }}" + runs-on: ubuntu-latest + needs: get-label + name: Check changelog update + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v37 + + - name: Check changelog file + run: | + changed_files_string="${{ steps.changed-files.outputs.all_changed_files }}" + read -ra changed_files_array <<< "$changed_files_string" + chmod +x scripts/changelog_check.sh + for changed_file in "${changed_files_array[@]}"; do + if [[ "$changed_file" == *"/template."* ]]; then + scripts/changelog_check.sh $(dirname $changed_file) + fi + done \ No newline at end of file diff --git a/.github/workflows/Synchronizing.yml b/.github/workflows/Synchronizing.yml index affa48d4..80a1e6b6 100644 --- a/.github/workflows/Synchronizing.yml +++ b/.github/workflows/Synchronizing.yml @@ -16,7 +16,7 @@ jobs: packages: ${{ env.packages }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Read matrix YAML id: read-matrix run: | @@ -30,7 +30,7 @@ jobs: touch template-readme-directory/file.tmp - name: Upload template-readme-directory - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: template-readme-directory path: ./template-readme-directory/ @@ -39,7 +39,7 @@ jobs: run: touch change_file_list.txt - name: Upload changes file list - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: change_file_list path: change_file_list.txt @@ -53,7 +53,7 @@ jobs: package: ${{ fromJSON(needs.Get-matrix.outputs.packages) }} max-parallel: 1 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - id: changes uses: dorny/paths-filter@v2 with: @@ -64,8 +64,8 @@ jobs: - if: steps.changes.outputs[matrix.package] == 'true' name: Change template and README to CF run: | - chmod +x replace_codeuri.sh - ./replace_codeuri.sh src/${{ matrix.package }}/template.* ${{ matrix.package }} src/${{ matrix.package }}/README.md + chmod +x scripts/replace_codeuri.sh + scripts/replace_codeuri.sh src/${{ matrix.package }}/template.* ${{ matrix.package }} src/${{ matrix.package }}/README.md - if: steps.changes.outputs[matrix.package] == 'true' name: Create template and readme directory @@ -83,10 +83,13 @@ jobs: run: | mv src/${{ matrix.package }}/README.md template-readme-directory/${{ matrix.package }}_README mv src/${{ matrix.package }}/template.* template-readme-directory/${{ matrix.package }}_template.yaml + if [ -f "src/${{ matrix.package }}/CHANGELOG.md" ]; then + mv src/${{ matrix.package }}/CHANGELOG.md template-readme-directory/${{ matrix.package }}_CHANGELOG.md + fi - if: steps.changes.outputs[matrix.package] == 'true' name: Upload template-readme-directory - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: template-readme-directory path: ./template-readme-directory/ @@ -103,7 +106,7 @@ jobs: - if: steps.changes.outputs[matrix.package] == 'true' name: Upload change_file_list - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: change_file_list path: change_file_list.txt @@ -114,7 +117,7 @@ jobs: steps: - name: Checkout destination repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: coralogix/cloudformation-coralogix-aws token: ${{ secrets.GH_TOKEN }} @@ -139,10 +142,16 @@ jobs: if [[ -d "aws-integrations/lambda-integrations/$line" ]]; then mv template-readme-directory/${line}_README aws-integrations/lambda-integrations/$line/README.md mv template-readme-directory/${line}_template.yaml aws-integrations/lambda-integrations/$line/template.yaml + if [ -f "template-readme-directory/${line}_CHANGELOG.md" ]; then + mv template-readme-directory/${line}_CHANGELOG.md aws-integrations/lambda-integrations/$line/CHANGELOG.md + fi else mkdir aws-integrations/lambda-integrations/$line/ mv template-readme-directory/${line}_README aws-integrations/lambda-integrations/$line/README.md mv template-readme-directory/${line}_template.yaml aws-integrations/lambda-integrations/$line/template.yaml + if [ -f "template-readme-directory/${line}_CHANGELOG.md" ]; then + mv template-readme-directory/${line}_CHANGELOG.md aws-integrations/lambda-integrations/$line/CHANGELOG.md + fi fi done < "change_file_list.txt" rm change_file_list.txt @@ -153,4 +162,4 @@ jobs: git pull git add . git commit -m "${{ github.event.pull_request.title }}#${{ github.event.pull_request.head.ref }}" - git push origin HEAD:master -f + git push origin HEAD:master -f \ No newline at end of file diff --git a/scripts/changelog_check.sh b/scripts/changelog_check.sh new file mode 100644 index 00000000..7cd8c17f --- /dev/null +++ b/scripts/changelog_check.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# Simply check if diff in changelog exists. +git diff --exit-code --quiet origin/master... ./$1/CHANGELOG.md +if [ $? -ne 1 ]; then + echo "Following files have been changed:" + echo $(git diff --name-only origin/master... ./$1) + echo "" + echo "Please add a changelog entry in $1/CHANGELOG.md or add 'skip changelog' label to your PR if this change does not require an entry". + exit 1 +fi \ No newline at end of file diff --git a/replace_codeuri.sh b/scripts/replace_codeuri.sh similarity index 100% rename from replace_codeuri.sh rename to scripts/replace_codeuri.sh diff --git a/src/archive-reader/CHANGELOG.md b/src/archive-reader/CHANGELOG.md new file mode 100644 index 00000000..f246d156 --- /dev/null +++ b/src/archive-reader/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## archive-reader + +### version / full date +* [Update/Bug fix] massage describe the changes \ No newline at end of file diff --git a/src/athena-s3/CHANGELOG.md b/src/athena-s3/CHANGELOG.md new file mode 100644 index 00000000..250df8ff --- /dev/null +++ b/src/athena-s3/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## athena-s3 + +### version / full date +* [Update/Bug fix] massage describe the changes \ No newline at end of file diff --git a/src/cloudtrail-sns/CHANGELOG.md b/src/cloudtrail-sns/CHANGELOG.md new file mode 100644 index 00000000..bb4b2c1c --- /dev/null +++ b/src/cloudtrail-sns/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## cloudtrail-sns + +### version / full date +* [Update/Bug fix] massage describe the changes \ No newline at end of file diff --git a/src/cloudtrail/CHANGELOG.md b/src/cloudtrail/CHANGELOG.md new file mode 100644 index 00000000..073413eb --- /dev/null +++ b/src/cloudtrail/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## cloudtrail + +### version / full date +* [Update/Bug fix] massage describe the changes \ No newline at end of file diff --git a/src/cloudwatch-logs/CHANGELOG.md b/src/cloudwatch-logs/CHANGELOG.md new file mode 100644 index 00000000..b0791ecf --- /dev/null +++ b/src/cloudwatch-logs/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## cloudwatch-logs + +### version / full date +* [Update/Bug fix] massage describe the changes \ No newline at end of file diff --git a/src/cloudwatch-metrics/CHANGELOG.md b/src/cloudwatch-metrics/CHANGELOG.md new file mode 100644 index 00000000..facd402e --- /dev/null +++ b/src/cloudwatch-metrics/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## cloudwatch-metrics + +### version / full date +* [Update/Bug fix] massage describe the changes \ No newline at end of file diff --git a/src/ecr/CHANGELOG.md b/src/ecr/CHANGELOG.md new file mode 100644 index 00000000..fd2ba85d --- /dev/null +++ b/src/ecr/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## ecr + +### version / full date +* [Update/Bug fix] massage describe the changes \ No newline at end of file diff --git a/src/elasticsearch-reporter/CHANGELOG.md b/src/elasticsearch-reporter/CHANGELOG.md new file mode 100644 index 00000000..95ba0868 --- /dev/null +++ b/src/elasticsearch-reporter/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## elasticsearch-reporter + +### version / full date +* [Update/Bug fix] massage describe the changes \ No newline at end of file diff --git a/src/kafka/CHANGELOG.md b/src/kafka/CHANGELOG.md new file mode 100644 index 00000000..7a30671c --- /dev/null +++ b/src/kafka/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## kafka + +### version / full date +* [Update/Bug fix] massage describe the changes \ No newline at end of file diff --git a/src/kinesis/CHANGELOG.md b/src/kinesis/CHANGELOG.md new file mode 100644 index 00000000..1c22dd91 --- /dev/null +++ b/src/kinesis/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## kinesis + +### version / full date +* [Update/Bug fix] massage describe the changes \ No newline at end of file diff --git a/src/lambda-extension/CHANGELOG.md b/src/lambda-extension/CHANGELOG.md new file mode 100644 index 00000000..4380e5ad --- /dev/null +++ b/src/lambda-extension/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## lambda-extenstion + +### version / full date +* [Update/Bug fix] massage describe the changes \ No newline at end of file diff --git a/src/lambda-manager/CHANGELOG.md b/src/lambda-manager/CHANGELOG.md new file mode 100644 index 00000000..548f7401 --- /dev/null +++ b/src/lambda-manager/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## lambda-manager + +### version / full date +* [Update/Bug fix] massage describe the changes \ No newline at end of file diff --git a/src/lambda-secretLayer/CHANGELOG.md b/src/lambda-secretLayer/CHANGELOG.md new file mode 100644 index 00000000..a67c0b35 --- /dev/null +++ b/src/lambda-secretLayer/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## lambda-secretLayer + +### version / full date +* [Update/Bug fix] massage describe the changes \ No newline at end of file diff --git a/src/msk/CHANGELOG.md b/src/msk/CHANGELOG.md new file mode 100644 index 00000000..06cb8526 --- /dev/null +++ b/src/msk/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## msk + +### version / full date +* [Update/Bug fix] massage describe the changes \ No newline at end of file diff --git a/src/resource-metadata/CHANGELOG.md b/src/resource-metadata/CHANGELOG.md new file mode 100644 index 00000000..1e6c1378 --- /dev/null +++ b/src/resource-metadata/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## resource-metadata + +### version / full date +* [Update/Bug fix] massage describe the changes \ No newline at end of file diff --git a/src/resource-tags/CHANGELOG.md b/src/resource-tags/CHANGELOG.md new file mode 100644 index 00000000..e65b9a12 --- /dev/null +++ b/src/resource-tags/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## resource-tags + +### version / full date +* [Update/Bug fix] massage describe the changes \ No newline at end of file diff --git a/src/s3-sns/CHANGELOG.md b/src/s3-sns/CHANGELOG.md new file mode 100644 index 00000000..e02e6612 --- /dev/null +++ b/src/s3-sns/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## s3-sns + +### version / full date +* [Update/Bug fix] massage describe the changes \ No newline at end of file diff --git a/src/s3/CHANGELOG.md b/src/s3/CHANGELOG.md new file mode 100644 index 00000000..722ef48f --- /dev/null +++ b/src/s3/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## s3 + +### version / full date +* [Update/Bug fix] massage describe the changes \ No newline at end of file diff --git a/src/sf-eventlog/CHANGELOG.md b/src/sf-eventlog/CHANGELOG.md new file mode 100644 index 00000000..0f9df476 --- /dev/null +++ b/src/sf-eventlog/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## sf-eventlog + +### version / full date +* [Update/Bug fix] massage describe the changes \ No newline at end of file diff --git a/src/sns/CHANGELOG.md b/src/sns/CHANGELOG.md new file mode 100644 index 00000000..392dab42 --- /dev/null +++ b/src/sns/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## sns + +### version / full date +* [Update/Bug fix] massage describe the changes \ No newline at end of file diff --git a/src/vpc-flow-logs/CHANGELOG.md b/src/vpc-flow-logs/CHANGELOG.md new file mode 100644 index 00000000..32308cad --- /dev/null +++ b/src/vpc-flow-logs/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## vpc-flow-logs + +### version / full date +* [Update/Bug fix] massage describe the changes \ No newline at end of file