DBZ-4653 Execute documentation changes workflow daily
This commit is contained in:
parent
61e7e71a9d
commit
f553264d01
2
.github/workflows/doc-changes-workflow.yml
vendored
2
.github/workflows/doc-changes-workflow.yml
vendored
@ -6,7 +6,7 @@ name: Documentation Changes
|
||||
on:
|
||||
# Schedule job to run at midnight UTC every Saturday
|
||||
schedule:
|
||||
- cron: "0 0 * * 6"
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
jobs:
|
||||
|
||||
|
@ -2,24 +2,29 @@
|
||||
|
||||
set -ouo > /dev/null 2>&1
|
||||
|
||||
GIT_SINCE="1.weeks"
|
||||
GIT_SINCE="24 hours ago"
|
||||
GITHUB_COMMIT_URL="https://github.com/debezium/debezium/commit/"
|
||||
OUTPUT="documentation_changes.txt"
|
||||
GIT_OUTPUT_FILE="git_history.txt"
|
||||
GIT_BRANCH=`git rev-parse --abbrev-ref HEAD`
|
||||
|
||||
# Get the history from Git
|
||||
git log --pretty=oneline --follow --since=$GIT_SINCE -- documentation > $GIT_OUTPUT_FILE
|
||||
git log --pretty=oneline --follow --since="$GIT_SINCE" -- documentation > $GIT_OUTPUT_FILE
|
||||
|
||||
rm -f $OUTPUT
|
||||
echo "The following Debezium documentation changes have been made in the last 7 days on branch \"$GIT_BRANCH\":" >> $OUTPUT
|
||||
echo "The following Debezium documentation changes have been made in the last 24 hours on branch \"$GIT_BRANCH\":" >> $OUTPUT
|
||||
echo "" >> $OUTPUT
|
||||
|
||||
while IFS=" " read -r COMMIT_SHA COMMIT_MSG
|
||||
do
|
||||
echo "* [$COMMIT_SHA]($GITHUB_COMMIT_URL$COMMIT_SHA)" >> $OUTPUT
|
||||
echo "$COMMIT_MSG" >> $OUTPUT
|
||||
done < $GIT_OUTPUT_FILE
|
||||
if [ -s "$GIT_OUTPUT_FILE" ]; then
|
||||
while IFS=" " read -r COMMIT_SHA COMMIT_MSG
|
||||
do
|
||||
echo "* [$COMMIT_SHA]($GITHUB_COMMIT_URL$COMMIT_SHA)" >> $OUTPUT
|
||||
echo "$COMMIT_MSG" >> $OUTPUT
|
||||
done < $GIT_OUTPUT_FILE
|
||||
else
|
||||
echo "* No changes found" >> $OUTPUT
|
||||
fi
|
||||
|
||||
rm -f $GIT_OUTPUT_FILE
|
||||
|
||||
cat $OUTPUT
|
Loading…
Reference in New Issue
Block a user