Skip to content

Commit

Permalink
Create new action changelog and add changelog file to the integrations
Browse files Browse the repository at this point in the history
Signed-off-by: guyrenny <[email protected]>
  • Loading branch information
guyrenny committed Aug 1, 2023
1 parent e20c140 commit 83bb098
Show file tree
Hide file tree
Showing 26 changed files with 198 additions and 10 deletions.
Empty file.
42 changes: 42 additions & 0 deletions .github/workflows/Changelog.yaml
Original file line number Diff line number Diff line change
@@ -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/[email protected]

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
29 changes: 19 additions & 10 deletions .github/workflows/Synchronizing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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/
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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/
Expand All @@ -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
Expand All @@ -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 }}
Expand All @@ -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
Expand All @@ -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
11 changes: 11 additions & 0 deletions scripts/changelog_check.sh
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.
6 changes: 6 additions & 0 deletions src/archive-reader/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## archive-reader

### version / full date
* [Update/Bug fix] massage describe the changes
6 changes: 6 additions & 0 deletions src/athena-s3/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## athena-s3

### version / full date
* [Update/Bug fix] massage describe the changes
6 changes: 6 additions & 0 deletions src/cloudtrail-sns/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## cloudtrail-sns

### version / full date
* [Update/Bug fix] massage describe the changes
6 changes: 6 additions & 0 deletions src/cloudtrail/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## cloudtrail

### version / full date
* [Update/Bug fix] massage describe the changes
6 changes: 6 additions & 0 deletions src/cloudwatch-logs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## cloudwatch-logs

### version / full date
* [Update/Bug fix] massage describe the changes
6 changes: 6 additions & 0 deletions src/cloudwatch-metrics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## cloudwatch-metrics

### version / full date
* [Update/Bug fix] massage describe the changes
6 changes: 6 additions & 0 deletions src/ecr/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## ecr

### version / full date
* [Update/Bug fix] massage describe the changes
6 changes: 6 additions & 0 deletions src/elasticsearch-reporter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## elasticsearch-reporter

### version / full date
* [Update/Bug fix] massage describe the changes
6 changes: 6 additions & 0 deletions src/kafka/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## kafka

### version / full date
* [Update/Bug fix] massage describe the changes
6 changes: 6 additions & 0 deletions src/kinesis/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## kinesis

### version / full date
* [Update/Bug fix] massage describe the changes
6 changes: 6 additions & 0 deletions src/lambda-extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## lambda-extenstion

### version / full date
* [Update/Bug fix] massage describe the changes
6 changes: 6 additions & 0 deletions src/lambda-manager/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## lambda-manager

### version / full date
* [Update/Bug fix] massage describe the changes
6 changes: 6 additions & 0 deletions src/lambda-secretLayer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## lambda-secretLayer

### version / full date
* [Update/Bug fix] massage describe the changes
6 changes: 6 additions & 0 deletions src/msk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## msk

### version / full date
* [Update/Bug fix] massage describe the changes
6 changes: 6 additions & 0 deletions src/resource-metadata/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## resource-metadata

### version / full date
* [Update/Bug fix] massage describe the changes
6 changes: 6 additions & 0 deletions src/resource-tags/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## resource-tags

### version / full date
* [Update/Bug fix] massage describe the changes
6 changes: 6 additions & 0 deletions src/s3-sns/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## s3-sns

### version / full date
* [Update/Bug fix] massage describe the changes
6 changes: 6 additions & 0 deletions src/s3/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## s3

### version / full date
* [Update/Bug fix] massage describe the changes
6 changes: 6 additions & 0 deletions src/sf-eventlog/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## sf-eventlog

### version / full date
* [Update/Bug fix] massage describe the changes
6 changes: 6 additions & 0 deletions src/sns/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## sns

### version / full date
* [Update/Bug fix] massage describe the changes
6 changes: 6 additions & 0 deletions src/vpc-flow-logs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## vpc-flow-logs

### version / full date
* [Update/Bug fix] massage describe the changes

0 comments on commit 83bb098

Please sign in to comment.