-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (43 loc) · 1.6 KB
/
auto-update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# =================================================== #
# Automatically Generated Workflow File, DO NOT EDIT! #
# =================================================== #
name: Automatic Updates
on:
workflow_call:
secrets:
git_token:
required: true
jobs:
auto-update:
runs-on: ubuntu-latest
name: Automatic Updates
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
token: ${{ secrets.git_token || github.token }}
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
registry-url: https://registry.npmjs.org
node-version: 20
- name: Check and apply dependencies updates
run: |
# Check for updates, and exit script on error / no updates found
npx '@juit/check-updates' --bump || exit $(( $? == 255 ? 0 : $? ))
# If still here, just run a full package update and install dependencies
rm -rf node-modules package-lock.json
node -e 'process.exitCode=require("./package.json").workspaces?1:0' && \
npm install || npm install --workspaces --include-workspace-root
# Build our package
npm run build
# Commit all changes and push them back to the repo
git config user.email '[email protected]'
git config user.name 'Automatic Updates'
git commit -a -m "Release for automatic updates $(date '+%Y-%m-%d %H:%M:%S')"
git push -u origin '${{ github.ref_name }}'
env:
PGPASSWORD: github
PGHOST: localhost
PGUSER: github
PGPORT: 5432