Skip to content

Commit e099db9

Browse files
lint workflow to use pull_request and add Dependabot auto-merge (#166)
* lint workflow to use pull_request and add Dependabot auto-merge * rename
1 parent 0031662 commit e099db9

File tree

2 files changed

+27
-29
lines changed

2 files changed

+27
-29
lines changed

.github/workflows/dependabot.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
name: Lint & Validate
1+
name: Lint, validate & Dependabot auto-merge
22

33
on:
4-
pull_request_target:
4+
pull_request:
55
branches:
66
- main
77
workflow_dispatch:
88

99
jobs:
1010
lint:
11-
name: Lint & Validate
11+
name: Lint & validate
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v4
1616
with:
17-
ref: ${{ github.event.pull_request.head.sha }}
1817
fetch-depth: 0
1918

2019
- name: Install dependencies
@@ -27,3 +26,27 @@ jobs:
2726
- name: Validate
2827
run: |
2928
npm run validate
29+
30+
dependabot:
31+
name: Dependabot auto-merge
32+
runs-on: ubuntu-latest
33+
needs: lint
34+
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'HTTPArchive/wappalyzer'
35+
36+
permissions:
37+
contents: write
38+
pull-requests: write
39+
40+
steps:
41+
- name: Dependabot metadata
42+
id: metadata
43+
uses: dependabot/fetch-metadata@v2
44+
with:
45+
github-token: "${{ secrets.GITHUB_TOKEN }}"
46+
47+
- name: Enable auto-merge for Dependabot PRs
48+
if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'
49+
run: gh pr merge --auto --squash "$PR_URL"
50+
env:
51+
PR_URL: ${{github.event.pull_request.html_url}}
52+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)