mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-03-13 12:05:15 +00:00
The previous implementation checked `github.event.sender.login`, which is whoever triggered the event (e.g., someone closing/reopening the PR). This fixes it to check `github.event.pull_request.user.login` instead — the PR author — so the workflow runs correctly whenever a Dependabot-created PR is opened, synchronized, or reopened.
40 lines
1.0 KiB
YAML
40 lines
1.0 KiB
YAML
name: Dependabot Build
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
if: github.event.pull_request.user.login == 'dependabot[bot]'
|
|
steps:
|
|
- name: Checkout PR branch
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
ref: ${{ github.head_ref }}
|
|
persist-credentials: false
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
|
with:
|
|
node-version-file: .nvmrc
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build and test
|
|
run: npm run all
|
|
|
|
- name: Commit built dist
|
|
uses: stefanzweifel/git-auto-commit-action@b863ae1933cb653a53c021fe36dbb774e1fb9403 # v5
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
commit_message: "Build dist for Dependabot update"
|
|
file_pattern: dist/
|