ci(actions): restrict 'pull_request' runs to outer PRs

'push' runs will run anyway on commits inside of repository
This commit is contained in:
Alexander Minkin 2025-01-31 18:53:56 +03:00
parent 6ec54a379d
commit 62cb1ce8f4
Signed by untrusted user: WerySkok
GPG key ID: 88E9A2F3AFE44C30
3 changed files with 31 additions and 0 deletions

View file

@ -13,6 +13,12 @@ jobs:
build-cli:
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:
- uses: actions/checkout@v3
with:
@ -43,6 +49,12 @@ jobs:
build-apache:
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:
- uses: actions/checkout@v3
with:

View file

@ -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
@ -65,6 +71,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

View file

@ -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: