Skip to content

Commit

Permalink
Update automation.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
OfficialCodeVoyage authored Oct 7, 2024
1 parent 23142a4 commit cb24ad0
Showing 1 changed file with 58 additions and 58 deletions.
116 changes: 58 additions & 58 deletions .github/workflows/automation.yml
Original file line number Diff line number Diff line change
@@ -1,72 +1,72 @@
name: GitHub Follower Bot
# name: GitHub Follower Bot

on:
schedule:
- cron: '0 */12 * * *' # Runs every 12 hours
workflow_dispatch:
# on:
# schedule:
# - cron: '0 */12 * * *' # Runs every 12 hours
# workflow_dispatch:

permissions:
contents: write # Needed for committing and pushing changes
actions: read
packages: write
# permissions:
# contents: write # Needed for committing and pushing changes
# actions: read
# packages: write

jobs:
follow-bot:
runs-on: ubuntu-latest
# jobs:
# follow-bot:
# runs-on: ubuntu-latest

env:
GITHUB_USER: officialcodevoyage
PERSONAL_GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
# env:
# GITHUB_USER: officialcodevoyage
# PERSONAL_GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 1
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
# with:
# fetch-depth: 1

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8' # Consider updating to a newer version if possible
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: '3.8' # Consider updating to a newer version if possible

- name: Upgrade pip
run: python -m pip install --upgrade pip
# - name: Upgrade pip
# run: python -m pip install --upgrade pip

- name: Install Pipenv
run: pip install pipenv
# - name: Install Pipenv
# run: pip install pipenv

- name: Cache Pipenv dependencies
uses: actions/cache@v3
with:
path: |
~/.local/share/pipenv
~/.cache/pip
~/.venv
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pipenv-
# - name: Cache Pipenv dependencies
# uses: actions/cache@v3
# with:
# path: |
# ~/.local/share/pipenv
# ~/.cache/pip
# ~/.venv
# key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
# restore-keys: |
# ${{ runner.os }}-pipenv-

- name: Install dependencies
run: pipenv install --deploy --ignore-pipfile
# - name: Install dependencies
# run: pipenv install --deploy --ignore-pipfile

- name: Verify Pipenv Installation
run: pipenv --version
# - name: Verify Pipenv Installation
# run: pipenv --version

- name: List Installed Packages
run: pipenv run pip list
# - name: List Installed Packages
# run: pipenv run pip list

- name: Run Follower Bot
env:
GITHUB_USER: ${{ env.GITHUB_USER }}
PERSONAL_GITHUB_TOKEN: ${{ env.PERSONAL_GITHUB_TOKEN }}
run: pipenv run python bot.py
# - name: Run Follower Bot
# env:
# GITHUB_USER: ${{ env.GITHUB_USER }}
# PERSONAL_GITHUB_TOKEN: ${{ env.PERSONAL_GITHUB_TOKEN }}
# run: pipenv run python bot.py

- name: Commit and Push Changes
if: github.ref == 'refs/heads/main' # Ensures it runs only on the main branch
run: |
git config user.name "OfficialCodeVoyage"
git config user.email "[email protected]"
git add -A
timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
git commit -m "Automated Commit: ${timestamp} (UTC)" || echo "No changes to commit."
git push origin main
# - name: Commit and Push Changes
# if: github.ref == 'refs/heads/main' # Ensures it runs only on the main branch
# run: |
# git config user.name "OfficialCodeVoyage"
# git config user.email "[email protected]"
# git add -A
# timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
# git commit -m "Automated Commit: ${timestamp} (UTC)" || echo "No changes to commit."
# git push origin main

0 comments on commit cb24ad0

Please sign in to comment.