Scope Moniter #25799
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: Scope Moniter | |
| on: | |
| schedule: | |
| - cron: '*/10 * * * *' | |
| push: | |
| branches: | |
| - main | |
| # Actions project permission | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v3 | |
| - name: Installing tar and unew via binary | |
| run: | | |
| sudo apt install unzip -y | |
| sudo apt install tar | |
| wget https://github.com/rix4uni/unew/releases/download/v0.0.5/unew-linux-amd64-0.0.5.tgz | |
| tar -xvzf unew-linux-amd64-0.0.5.tgz | |
| mv unew /usr/local/bin/unew | |
| rm -rf unew-linux-amd64-0.0.5.tgz | |
| - name: Running scope_moniter.sh | |
| run: | | |
| bash scope_moniter.sh | |
| - name: Commit and push changes if there are any | |
| run: | | |
| git config --global user.name 'GitHub Actions' | |
| git config --global user.email 'actions@users.noreply.github.com' | |
| git add . | |
| # Check if there are changes before committing | |
| if ! git diff --cached --exit-code; then | |
| IST_DATE=$(TZ='Asia/Kolkata' date +'%a %b %d %H:%M:%S IST %Y') | |
| git commit -m "Updated List: $IST_DATE" | |
| git push | |
| else | |
| echo "No changes to commit" | |
| fi |