Skip to content

Commit 5b49817

Browse files
committed
fix: run install when dependabot updates us
1 parent 3571330 commit 5b49817

File tree

3 files changed

+63
-0
lines changed

3 files changed

+63
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This file is automatically added by @npmcli/template-oss. Do not edit.
2+
3+
name: "Post Dependabot Actions"
4+
on: pull_request
5+
6+
jobs:
7+
Install:
8+
runs-on: ubuntu-latest
9+
if: ${{ github.actor == 'dependabot[bot]' }}
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: '16'
15+
- name: Dependabot metadata
16+
id: metadata
17+
uses: dependabot/[email protected]
18+
with:
19+
github-token: "${{ secrets.GITHUB_TOKEN }}"
20+
- name: npm install and commit
21+
if: ${{contains(steps.metadata.outputs.dependency-names, '@npmcli/template-oss')}}
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
run: |
25+
git config --local user.email "[email protected]"
26+
git config --local user.name "npm cli ops bot"
27+
gh pr checkout ${{ github.event.pull_request.number }}
28+
npm install
29+
git add .
30+
git commit -am "chore: postinstall for dependabot template-oss PR"
31+
git push origin ${{github.ref_name}}

lib/content/post-dependabot.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This file is automatically added by @npmcli/template-oss. Do not edit.
2+
3+
name: "Post Dependabot Actions"
4+
on: pull_request
5+
6+
jobs:
7+
Install:
8+
runs-on: ubuntu-latest
9+
if: ${{ github.actor == 'dependabot[bot]' }}
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: '16'
15+
- name: Dependabot metadata
16+
id: metadata
17+
uses: dependabot/[email protected]
18+
with:
19+
github-token: "${{ secrets.GITHUB_TOKEN }}"
20+
- name: npm install and commit
21+
if: ${{contains(steps.metadata.outputs.dependency-names, '@npmcli/template-oss')}}
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
run: |
25+
git config --local user.email "[email protected]"
26+
git config --local user.name "npm cli ops bot"
27+
gh pr checkout ${{ github.event.pull_request.number }}
28+
npm install
29+
git add .
30+
git commit -am "chore: postinstall for dependabot template-oss PR"
31+
git push origin ${{github.ref_name}}

lib/postinstall/copy-content.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const repoFiles = {
2222
'.github/dependabot.yml': './dependabot.yml',
2323
'.github/workflows/audit.yml': './audit.yml',
2424
'.github/workflows/codeql-analysis.yml': './codeql-analysis.yml',
25+
'.github/workflows/post-dependabot.yml': './post-dependabot.yml',
2526
'.github/workflows/pull-request.yml': './pull-request.yml',
2627
'.github/workflows/release-please.yml': './release-please.yml',
2728
}

0 commit comments

Comments
 (0)