-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (38 loc) · 1.27 KB
/
Copy pathprebuild.yml
File metadata and controls
49 lines (38 loc) · 1.27 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
name: Prebuild dependabot PRs
on:
pull_request:
branches: main
jobs:
build:
if: github.actor == 'dependabot[bot]' || github.actor == 'rviscomi'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run build script
run: npm run build
- name: Commit and push changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
# Add all changes (tracked and untracked)
git add .
# Check if there are any changes to commit
if ! git diff --cached --quiet; then
echo "✅ Changes detected, committing build artifacts..."
git commit -m "chore: Update build artifacts" -m "Generated by GitHub Actions for Dependabot PR"
git push origin ${{ github.head_ref }}
else
echo "ℹ️ No changes to commit."
fi