Daily Issue Creator #347
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: Daily Issue Creator | |
| on: | |
| schedule: | |
| - cron: "50 9 * * *" # Runs daily at 8:50 UTC (9:50 AM NZDT) | |
| workflow_dispatch: # Allows manual triggering | |
| jobs: | |
| create-issue: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Calculate Timestamps | |
| run: | | |
| START_TIME=$(date -u -d "+10 minutes" +"%Y-%m-%dT%H:%M:%S.%3NZ") | |
| END_TIME=$(date -u -d "+1 hour" +"%Y-%m-%dT%H:%M:%S.%3NZ") | |
| TODAY_DATE=$(date -u +"%Y-%m-%d") | |
| echo "START_TIME=$START_TIME" >> $GITHUB_ENV | |
| echo "END_TIME=$END_TIME" >> $GITHUB_ENV | |
| echo "TODAY_DATE=$TODAY_DATE" >> $GITHUB_ENV | |
| # Create issue content file | |
| cat <<EOF > issue-body.md | |
| <!-- | |
| start: $START_TIME | |
| end: $END_TIME | |
| --> | |
| 🌟 **ElfHosted's Daily Glowup!** 🌟 | |
| Every day, we take some time to refresh and enhance ElfHosted services. This is our scheduled maintenance period where we apply **OS and app updates** to keep everything running smoothly. | |
| 🔧 **Scheduled Time:** | |
| - **Start:** \`$START_TIME\` | |
| - **End:** \`$END_TIME\` | |
| If you notice any temporary disruptions, don't worry—it's just a part of the glowup! For more details or to chat with the community, visit our [friendly Discord server](https://discord.elfhosted.com) | |
| Thanks for being part of ElfHosted! ✨ | |
| EOF | |
| - name: Create GitHub Issue | |
| uses: peter-evans/create-issue-from-file@v5 | |
| with: | |
| title: "ElfHosted Glowup - ${{ env.TODAY_DATE }}" | |
| content-filepath: issue-body.md | |
| token: ${{ secrets.GITHUB_TOKEN }} |