Update Arcane Blessings Dependency #257
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: Update Arcane Blessings Dependency | |
on: | |
schedule: | |
- cron: "0 0 * * *" # Schedule the workflow to run daily | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16 # Use your desired Node.js version | |
- name: Check for Updates | |
run: | | |
# Check the latest version of arcane-blessings on npm | |
latest_version=$(npm show arcane-blessings version) | |
# Compare the latest version with the current version in package.json | |
current_version=$(node -e "console.log(require('./package.json').dependencies['arcane-blessings'])") | |
if [ "$latest_version" != "$current_version" ]; then | |
echo "New version available: $latest_version" | |
npm install "arcane-blessings@$latest_version" | |
git config --global user.email "statecznylukas@gmail.com" | |
git config --global user.name "nalnir" | |
git pull | |
git commit -am "Update arcane-blessings to $latest_version" | |
git push origin main | |
else | |
echo "No updates available" | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |