Skip to content

Commit

Permalink
Update Update Yonode Package.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sharafdin authored May 4, 2024
1 parent 6486644 commit 49af0e9
Showing 1 changed file with 28 additions and 23 deletions.
51 changes: 28 additions & 23 deletions .github/workflows/Update Yonode Package.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,44 @@
name: Update Yonode Templates Independently
name: Update Yonode Package

on:
schedule:
- cron: '*/5 * * * *'
# Runs every day at 05:00 UTC
- cron: '0 5 * * *'
workflow_dispatch:

jobs:
some-job:
update-yonode:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Necessary to ensure the history is available for operations like push
- uses: actions/setup-node@v4
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
node-version: '16'

- name: Make changes and commit
- name: Change directory to yonode
run: cd packages/yonode-templates/JS-MongoDB-Mongoose-Auth-Template

- name: Install npm-check-updates
run: npm install -g npm-check-updates

- name: Update package.json if newer versions are available
run: |
# Your commands to update files or dependencies
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
git checkout -b new-branch-for-updates
# Make some changes
git add .
git commit -m "Update dependencies"
git push origin new-branch-for-updates
ncu -u
- name: Create Pull Request
- name: Create Pull Request for updated package.json
id: cpr
uses: peter-evans/create-pull-request@v4
with:
commit-message: "Update dependencies"
title: "Update dependencies"
body: "Automatically generated PR to update dependencies."
branch: new-branch-for-updates
commit-message: Update dependencies in Yonode
title: 'Update Yonode dependencies'
body: 'This pull request updates dependencies for the Yonode package.'
branch: 'update-yonode-dependencies'
base: 'main'
labels: 'dependencies'
token: ${{ secrets.GITHUB_TOKEN }} # Default GitHub token
token: ${{ secrets.GITHUB_TOKEN }}

- name: Check outputs
run: echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"

0 comments on commit 49af0e9

Please sign in to comment.