Skip to content

auto-update-packages #20

auto-update-packages

auto-update-packages #20

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 }}
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: |
export COMMIT_MESSAGE="chore: auto updated dependencies on $(date +'%d/%m/%Y')"
- 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: ${{ env.COMMIT_MESSAGE }}
body: "This PR updates the dependencies automatically."
commit-message: ${{ env.COMMIT_MESSAGE }}