-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
94 lines (83 loc) · 2.33 KB
/
action.yml
File metadata and controls
94 lines (83 loc) · 2.33 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: 'Package bump'
description: 'Package bump'
inputs:
gh_token:
description: 'GitHub token'
required: true
folder_path:
description: 'Folder path'
required: false
repository_url:
description: 'Repository url'
required: true
repository_branch:
description: 'repository branch'
required: false
default: 'dev'
propagation_delay:
description: 'Seconds to wait for npm package propagation before installing'
required: false
default: '30'
runs:
using: 'composite'
steps:
- name: Wait for npm propagation
shell: bash
run: |
DELAY="${{ inputs.propagation_delay }}"
echo "Waiting ${DELAY}s for npm package propagation..."
sleep "$DELAY"
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
path: tmp
token: ${{ inputs.gh_token }}
repository: ${{ inputs.repository_url }}
ref: ${{ inputs.repository_branch }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 24.4.0
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: '10'
- name: Install dependencies
shell: bash
run: |
if [ -n "${{ inputs.folder_path }}" ]; then
cd "tmp/${{ inputs.folder_path }}"
else
cd tmp
fi
pnpm install
- name: Prepare Nuxt
shell: bash
run: |
if [ -n "${{ inputs.folder_path }}" ]; then
cd "tmp/${{ inputs.folder_path }}"
else
cd tmp
fi
# Only run nuxi prepare if this is a Nuxt project
if [ -f "nuxt.config.ts" ] || [ -f "nuxt.config.js" ]; then
echo "Nuxt config found, running nuxi prepare..."
npx nuxi prepare
else
echo "No Nuxt config found, skipping nuxi prepare"
fi
- name: Commit changes
shell: bash
run: |
cd tmp
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
# Check if there are any changes to commit
if [ -z "$(git status --porcelain)" ]; then
echo "No changes to commit"
exit 0
fi
git add .
git commit -m "chore: package bump"
git push origin "${{ inputs.repository_branch }}"