.github/workflows/Actions.yml #36
This file contains 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: Readme Automation | |
on: | |
schedule: | |
- cron: "0 12 * * *" | |
jobs: | |
update-readme: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install Dependencies | |
run: | | |
cd ActionWorkflow_Integration | |
npm install | |
- name: Update README and Push Changes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
cd ActionWorkflow_Integration | |
npm run dev | |
git config user.email "[email protected]" | |
git config user.name "UjjwalSaini07" | |
# Stash any unstaged changes | |
git stash --include-untracked | |
# Pull the latest changes to avoid conflicts | |
git pull origin main --rebase | |
# Apply the stashed changes | |
git stash pop || true | |
# Check if there are any changes before committing | |
if [ -n "$(git status --porcelain)" ]; then | |
git add README.md | |
git commit -m "Auto Updated README on $(TZ=Asia/Kolkata date +'%Y-%m-%d %H:%M')" | |
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/UjjwalSaini07/DecryptorX_Stealer.git main | |
else | |
echo "No changes to commit." | |
fi |