Skip to content
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.

feat: add Twitter post notification on new blog article #54

Closed
wants to merge 2 commits into from
Closed

feat: add Twitter post notification on new blog article #54

wants to merge 2 commits into from

Conversation

dev-liro
Copy link
Contributor

I'm not exactly too sure about this commit, but could the maintainers test it please ?

@dev-liro dev-liro requested review from elhmn and RMPR as code owners January 11, 2022 15:23
@dev-liro
Copy link
Contributor Author

I forgot to mention, but this PR concerns issue #50

Copy link
Member

@Sanix-Darker Sanix-Darker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR, i left some small comments for you !

.github/workflows/blog-deploy.yaml Outdated Show resolved Hide resolved
Comment on lines +104 to +128
find ./content/post -name '*.md' | sort | uniq > current_branch_files
CURRENT_BRANCH_FILES=$(cat current_branch_files)
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git stash && git checkout HEAD~ && git clean -fdx && \
find ./content/post -name '*.md' | sort | uniq > previous_branch_files
PREVIOUS_BRANCH_FILES=$(cat previous_branch_files)
echo "current_branch_files=$CURRENT_BRANCH_FILES"
echo "========================================="
echo "previous_branch_files=$PREVIOUS_BRANCH_FILES"
echo "++++++++++++++++++++++++++++++++++++++++++++"
echo "$CURRENT_BRANCH_FILES" > current_branch_files

set +e
POTENTIAL_ARTICLES=$(diff current_branch_files previous_branch_files | grep "content" | sed 's/[<>] //g')
set -e

#Fail if there was no potential articles found
test ! -z "$POTENTIAL_ARTICLES"
echo "message<<EOF" >> $GITHUB_ENV
echo "Checkout this article on our blog." >> $GITHUB_ENV
for article in $POTENTIAL_ARTICLES; do
echo "> https://blog.osscameroon.com$(echo $article | sed "s/\.md//g; s/^\.\/content//g")" >> $GITHUB_ENV
done
echo "EOF" >> $GITHUB_ENV
Copy link
Member

@Sanix-Darker Sanix-Darker Jan 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional suggestion:
I will suggest to add this inside a bash script following the example made on 'notify_on_pull_request', so that this file will doesn't get too fat ('blog-deploy/blog-deploy.sh')...

What do you think ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

@RMPR RMPR requested a review from Sanix-Darker February 26, 2022 21:14
@elhmn
Copy link
Member

elhmn commented Apr 1, 2022

@elhmn note to myself 👉 review this at some point

@dev-liro dev-liro closed this by deleting the head repository Apr 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants