Skip to content

Commit

Permalink
ci(actions): restrict 'pull_request' runs to outer PRs (#1221)
Browse files Browse the repository at this point in the history
'push' runs will run anyway on commits inside of repository
  • Loading branch information
WerySkok authored Jan 31, 2025
1 parent 6ec54a3 commit 8a979fa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ jobs:

runs-on: ubuntu-latest

# 'push' runs on inner branches, 'pull_request' will run only on outer PRs
if: >
github.event_name == 'push'
|| (github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.full_name != github.repository)
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand Down Expand Up @@ -64,6 +70,12 @@ jobs:
name: Build DB images

runs-on: ubuntu-latest

# 'push' runs on inner branches, 'pull_request' will run only on outer PRs
if: >
github.event_name == 'push'
|| (github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.full_name != github.repository)
steps:
- name: Set up QEMU
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ on:
jobs:
lint:
runs-on: ubuntu-20.04

# 'push' runs on inner branches, 'pull_request' will run only on outer PRs
if: >
github.event_name == 'push'
|| (github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.full_name != github.repository)
permissions:
contents: read
steps:
Expand Down

0 comments on commit 8a979fa

Please sign in to comment.