Skip to content

Commit

Permalink
ci: check PR user instead of workflow actor
Browse files Browse the repository at this point in the history
  • Loading branch information
maliroteh-sf committed Jan 8, 2025
1 parent 3820b5b commit a072fc8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Auto-Merge Dependabot PRs (only for changes to minor or patch version but not major version)
name: Auto-Merge Dependabot PRs (minor/patch only)

on:
pull_request:
Expand All @@ -7,14 +7,15 @@ on:

jobs:
auto-merge:
if: github.actor == 'dependabot[bot]' # Ensures this only runs for Dependabot PRs
if: github.event.pull_request.user.login == 'dependabot[bot]' # Ensures this only runs for Dependabot PRs
runs-on: ubuntu-latest
steps:
- name: Check if the PR has the 'dependencies' label
uses: actions/github-script@v6
id: check-label
with:
script: |
const core = require('@actions/core');
const { context } = require('@actions/github');
const { labels } = context.payload.pull_request;
Expand Down Expand Up @@ -43,6 +44,7 @@ jobs:
uses: actions/github-script@v6
with:
script: |
const core = require('@actions/core');
const { context, github } = require('@actions/github');
const { pull_request } = context.payload;
Expand Down

0 comments on commit a072fc8

Please sign in to comment.