| 1 |
# This file is automatically added by @npmcli/template-oss. Do not edit. |
| 2 |
|
| 3 |
name: Post Dependabot Actions |
| 4 |
|
| 5 |
on: pull_request |
| 6 |
|
| 7 |
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions |
| 8 |
permissions: |
| 9 |
contents: write |
| 10 |
|
| 11 |
jobs: |
| 12 |
template-oss-apply: |
| 13 |
runs-on: ubuntu-latest |
| 14 |
if: github.actor == 'dependabot[bot]' |
| 15 |
steps: |
| 16 |
- uses: actions/checkout@v3 |
| 17 |
- name: Setup git user |
| 18 |
run: | |
| 19 |
git config --global user.email "[email protected]" |
| 20 |
git config --global user.name "npm CLI robot" |
| 21 |
- uses: actions/setup-node@v3 |
| 22 |
with: |
| 23 |
node-version: 16.x |
| 24 |
- name: Update npm to latest |
| 25 |
run: npm i --prefer-online --no-fund --no-audit -g npm@latest |
| 26 |
- run: npm -v |
| 27 |
- name: Dependabot metadata |
| 28 |
id: metadata |
| 29 |
uses: dependabot/[email protected] |
| 30 |
with: |
| 31 |
github-token: "${{ secrets.GITHUB_TOKEN }}" |
| 32 |
- name: npm install and commit |
| 33 |
if: contains(steps.metadata.outputs.dependency-names, '@npmcli/template-oss') |
| 34 |
env: |
| 35 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 36 |
run: | |
| 37 |
gh pr checkout ${{ github.event.pull_request.number }} |
| 38 |
npm install --ignore-scripts --no-audit --no-fund |
| 39 |
npm run template-oss-apply |
| 40 |
git add . |
| 41 |
git commit -am "chore: postinstall for dependabot template-oss PR" |
| 42 |
git push |
| 43 |
npm run lint |