Update README - Development Suspended Counter #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update README - Development Suspended Counter | |
on: | |
schedule: | |
- cron: '29 10 * * *' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
update-readme: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Calculate Elapsed Days and Update README | |
run: | | |
# Determine if external commits are present | |
LAST_WORKFLOW_COMMIT=$(git log --grep="docs(update-readme): update README" -n 1 --format=%H) | |
CURRENT_COMMIT=$(git rev-parse HEAD) | |
if [ "$CURRENT_COMMIT" != "$LAST_WORKFLOW_COMMIT" ]; then | |
DAYS=0 | |
echo "External commits detected. Setting elapsed days to 0." | |
else | |
HALT_DATE="2025-03-19" | |
CURRENT_DATE=$(date +%Y-%m-%d) | |
DAYS=$(( ( $(date -d "$CURRENT_DATE" +%s) - $(date -d "$HALT_DATE" +%s) )/(60*60*24) )) | |
echo "Calculated elapsed days: $DAYS" | |
fi | |
sed -i "s/<!--HALTED-DAYS-->.*<!--HALTED-DAYS-->/<!--HALTED-DAYS-->🔮 Project Status: Development Temporarily Suspended – $DAYS Days Elapsed<!--HALTED-DAYS-->/" README.md | |
echo "Updated README.md content:" | |
cat README.md | |
- name: Commit and Push Changes | |
run: | | |
git config user.name "rhythmusbyte" | |
git config user.email "akhilmahesh@proton.me" | |
git add README.md | |
if [ -n "$(git status --porcelain)" ]; then | |
git commit -m "docs(update-readme): update README with $DAYS days elapsed" | |
git push --force | |
else | |
echo "No changes detected." | |
fi |