Skip to content

Commit 651f998

Browse files
🛠️ Build Dependabot updates (#298)
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). --------- Co-authored-by: Samuel Giddins <segiddins@segiddins.me>
1 parent cc8797f commit 651f998

1 file changed

Lines changed: 63 additions & 0 deletions

File tree

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Compile Dependabot Updates
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
build:
8+
# PR was opened by Dependabot PR has 'javascript' label
9+
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' && contains(github.event.pull_request.labels.*.name, 'javascript') }}
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
steps:
14+
- name: Checkout Pull Request
15+
uses: actions/checkout@v4
16+
with:
17+
persist-credentials: false
18+
19+
- name: Set up Node
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version-file: .nvmrc
23+
cache: 'npm'
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Build and package
29+
run: npm run build && npm run package
30+
31+
- name: Upload build artifacts
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: dist
35+
path: dist/
36+
retention-days: 1
37+
38+
commit-artifacts:
39+
needs: build
40+
runs-on: ubuntu-latest
41+
permissions:
42+
contents: write
43+
pull-requests: write
44+
steps:
45+
- name: Checkout Pull Request
46+
uses: actions/checkout@v4
47+
with:
48+
token: ${{ secrets.GITHUB_TOKEN }}
49+
fetch-depth: 0
50+
persist-credentials: false
51+
52+
- name: Download build artifacts
53+
uses: actions/download-artifact@v4
54+
with:
55+
name: dist
56+
path: dist/
57+
58+
- name: Commit and push build artifacts
59+
run: |
60+
git config user.name "github-actions[bot]"
61+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
62+
git add dist/
63+
git commit -m "[dependabot skip] Update dist/ with compiled dependencies" && git push || exit 0

0 commit comments

Comments
 (0)