Skip to content

auto-update-packages #21

auto-update-packages

auto-update-packages #21

Workflow file for this run

name: auto-update-packages
on:
schedule:
# Runs "At 00:00 on Sunday." (see https://crontab.guru)
- cron: '0 0 * * 0'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
NX_BASE: origin/main
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
COMMIT_MESSAGE: "chore: auto updated dependencies"
jobs:
update:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
- name: setup repo
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: setup pnpm
uses: pnpm/action-setup@v3
- name: setup node
uses: actions/setup-node@v4
with:
node-version-file: "package.json"
cache: "pnpm"
- name: setup env
run: |
echo "chore: auto updated dependencies on $(date +'%d/%m/%Y')" >> $COMMIT_MESSAGE
- name: log params
run: |
echo NX_BASE = $NX_BASE
echo node version = $(node --version)
echo pnpm version = $(pnpm --version)
echo COMMIT_MESSAGE = $COMMIT_MESSAGE
# - name: checkout update-dependencies branch
# run: |
# git config --global user.name "github-actions[bot]"
# git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
# git fetch origin
# if git ls-remote --heads origin refs/heads/update-dependencies; then
# git checkout update-dependencies
# git pull origin update-dependencies
# else
# git checkout -b update-dependencies
# fi
- name: update dependencies
run: |
pnpm test:config
- name: create or update pull request
uses: peter-evans/create-pull-request@v6
with:
reviewers: 'jhasuraj01'
branch: update-dependencies
base: main
title: $COMMIT_MESSAGE
body: "This PR updates the dependencies automatically."
commit-message: $COMMIT_MESSAGE