Skip to content

Commit

Permalink
chore: Update workflow to better handle Dependabot (#372)
Browse files Browse the repository at this point in the history
  • Loading branch information
HorizonNet authored Oct 31, 2023
1 parent a19997c commit 64826b8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,26 @@ jobs:
build:
name: Gradle build

# If the PR is coming from a fork (pull_request_target), ensure it's opened by "dependabot[bot]".
# Otherwise, clone it normally.
if: |
(github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]') ||
(github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]')
runs-on: ubuntu-20.04

steps:
- name: Checkout
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Checkout
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/[email protected]
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up JDK 17
uses: actions/[email protected]
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,27 @@ jobs:
build:
name: Lint Code Base

# If the PR is coming from a fork (pull_request_target), ensure it's opened by "dependabot[bot]".
# Otherwise, clone it normally.
if: |
(github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]') ||
(github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]')
runs-on: ubuntu-20.04

steps:
- name: Checkout
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Checkout
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/[email protected]
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Lint Code Base
uses: super-linter/[email protected]
env:
Expand Down

0 comments on commit 64826b8

Please sign in to comment.