Skip to content

Commit c22e1f6

Browse files
authored
fix: restrict workflows to upstream repo (AstrBotDevs#6531)
1 parent 51c8d22 commit c22e1f6

7 files changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/coverage_test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
pytest --cov=astrbot -v -o log_cli=true -o log_level=DEBUG
4141
4242
- name: Upload results to Codecov
43+
if: github.repository == 'AstrBotDevs/AstrBot'
4344
uses: codecov/codecov-action@v5
4445
with:
4546
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/dashboard_ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
jobs:
1010
build:
11+
if: github.repository == 'AstrBotDevs/AstrBot'
1112
runs-on: ubuntu-latest
1213
steps:
1314
- name: Checkout repository

.github/workflows/docker-image.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
build-nightly-image:
14-
if: github.event_name == 'schedule'
14+
if: github.repository == 'AstrBotDevs/AstrBot' && github.event_name == 'schedule'
1515
runs-on: ubuntu-latest
1616
env:
1717
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
@@ -109,7 +109,7 @@ jobs:
109109
run: echo "Test Docker image has been built and pushed successfully"
110110

111111
build-release-image:
112-
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
112+
if: github.repository == 'AstrBotDevs/AstrBot' && (github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')))
113113
runs-on: ubuntu-latest
114114
env:
115115
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}

.github/workflows/pr-title-check.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
jobs:
88
title-format:
9+
if: github.repository == 'AstrBotDevs/AstrBot'
910
runs-on: ubuntu-latest
1011
permissions:
1112
pull-requests: write

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ permissions:
2020
jobs:
2121
build-dashboard:
2222
name: Build Dashboard
23+
if: github.repository == 'AstrBotDevs/AstrBot'
2324
runs-on: ubuntu-24.04
2425
env:
2526
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
@@ -104,6 +105,7 @@ jobs:
104105
105106
publish-release:
106107
name: Publish GitHub Release
108+
if: github.repository == 'AstrBotDevs/AstrBot'
107109
runs-on: ubuntu-24.04
108110
needs:
109111
- build-dashboard
@@ -183,6 +185,7 @@ jobs:
183185
184186
publish-pypi:
185187
name: Publish PyPI
188+
if: github.repository == 'AstrBotDevs/AstrBot'
186189
runs-on: ubuntu-24.04
187190
needs:
188191
- publish-release

.github/workflows/stale.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ on:
1818

1919
jobs:
2020
stale:
21+
if: github.repository == 'AstrBotDevs/AstrBot'
2122
runs-on: ubuntu-latest
2223
permissions:
2324
issues: write

.github/workflows/sync-wiki.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ concurrency:
1818

1919
jobs:
2020
sync:
21+
if: github.repository == 'AstrBotDevs/AstrBot'
2122
runs-on: ubuntu-latest
2223
permissions:
2324
contents: read

0 commit comments

Comments
 (0)