-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
28 additions
and
23 deletions.
There are no files selected for viewing
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
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 }}" |