Skip to content

Commit f4fbd44

Browse files
Build Dependabot updates
All of our TypeScript builds have failed in this project because we check to see if the `dist/` directory matches what is in the pull request. Dependabot will open a pull request with changes to the manifest/lock files, but it won't build the dependencies. By building them and committing, we should be able to pass the check we're enforcing. Note: I'm using `[dependabot skip]` in the commit message as it will allow Dependabot to rebase/recreate changes. Without that, the PR will be left open (and new changes will not be proposed).
1 parent e3f5097 commit f4fbd44

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Compile Dependabot Updates
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
build-dependencies:
8+
# PR was opened by Dependabot PR has 'javascript' label
9+
if: ${{ github.actor == 'dependabot[bot]' && contains(join(github.event.pull_request.labels.*.name, ','), 'javascript') }}
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
steps:
15+
- name: Checkout Pull Request
16+
uses: actions/checkout@v4
17+
with:
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
persists-credentials: false
20+
21+
- name: Set up Node
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version-file: .nvmrc
25+
cache: 'npm'
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Build and package
31+
run: npm run all
32+
33+
- name: Commit and push build artifacts
34+
run: |
35+
git config user.name "github-actions[bot]"
36+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
37+
git add dist/
38+
git commit -m "[dependabot skip] Update dist/ with compiled dependencies" && git push || exit 0

0 commit comments

Comments
 (0)