-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (40 loc) · 1.51 KB
/
dependabot_dist.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
name: Dependabot distribution
on:
pull_request:
types: [opened, synchronize]
permissions:
contents: write
pull-requests: read
jobs:
dependabot_build:
if: ${{ github.actor == 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- name: Fetch Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v2
- name: Checkout
uses: actions/checkout@v4
if: ${{ steps.dependabot-metadata.outputs.package-ecosystem == 'npm' }}
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node.js
if: ${{ steps.dependabot-metadata.outputs.package-ecosystem == 'npm' }}
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install dependencies
if: ${{ steps.dependabot-metadata.outputs.package-ecosystem == 'npm' }}
run: npm install
- name: Build
if: ${{ steps.dependabot-metadata.outputs.package-ecosystem == 'npm' }}
run: npm run build
- name: Pull request update
if: ${{ steps.dependabot-metadata.outputs.package-ecosystem == 'npm' }}
run: |
git config --global user.name 'some user'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git add dist/
git commit -m "Update distribution file"
git push -u origin HEAD:${{ github.event.pull_request.head.ref }}