Skip to content

Commit dc955b7

Browse files
authored
Add organization checks and standardize git configurations (#164)
* Add organization checks and standardize git configurations - Add `if: ${{ github.repository_owner == 'Armbian' }}` to ensure workflows only run in the Armbian organization - Standardize git configurations to use github-actions[bot] identity - Add explicit permissions declarations where missing - Update workflows: - data-update-base-files-info.yml - data-update-download-index.yml - data-update-image-info.yml - data-update-jira-excerpt.yml - data-update-partners-data.yml - data-update-rpi-imager-json.yml - generate-servers-jsons.yml - generate-torrent-tracker-lists.yml - infrastructure-mirror-repository-artifacts.yml - infrastructure-update-redirector-config.yml - web-directory-listing.yml - assets-generate-board-thumbnails.yml (all jobs) - community-enforce-triage-role.yml - community-invite-contributors.yml - maintenance-clean-workflow-logs.yml - maintenance-watchdog.yml - monitoring-runners-status.yml - testing-wireless-performance-test.yml This ensures these workflows only run in the Armbian organization and prevents execution on forks or other organizations.
1 parent f972bd7 commit dc955b7

18 files changed

Lines changed: 37 additions & 7 deletions

.github/workflows/assets-generate-board-thumbnails.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
Check:
2828
name: "Check permissions"
2929
runs-on: ubuntu-24.04
30+
if: ${{ github.repository_owner == 'Armbian' }}
3031
steps:
3132
- name: "Check permissions"
3233
uses: armbian/actions/team-check@main
@@ -38,6 +39,7 @@ jobs:
3839
Boards-index:
3940
name: "Build boards matrix"
4041
runs-on: ubuntu-24.04
42+
if: ${{ github.repository_owner == 'Armbian' }}
4143
needs: Check
4244
outputs:
4345
matrix: ${{ steps.boards.outputs.JSON_CONTENT }}
@@ -100,6 +102,7 @@ jobs:
100102
Vendors-index:
101103
name: "Build vendors matrix"
102104
runs-on: ubuntu-24.04
105+
if: ${{ github.repository_owner == 'Armbian' }}
103106
needs: Check
104107
outputs:
105108
matrix: ${{ steps.vendors.outputs.JSON_CONTENT }}
@@ -174,6 +177,7 @@ jobs:
174177
Generate-images:
175178
name: "Maker board & vendor pics"
176179
runs-on: ubuntu-24.04
180+
if: ${{ github.repository_owner == 'Armbian' }}
177181
needs: [Boards-index, Vendors-index]
178182
strategy:
179183
fail-fast: false
@@ -429,6 +433,7 @@ jobs:
429433
Summary:
430434
name: "Generate summary report"
431435
runs-on: ubuntu-24.04
436+
if: ${{ github.repository_owner == 'Armbian' }}
432437
needs: [Boards-index, Vendors-index, Generate-images]
433438
steps:
434439
- name: "Download all shard data"

.github/workflows/community-enforce-triage-role.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
enforce-triage:
2121
name: "Enforce Triage"
2222
runs-on: ubuntu-latest
23+
if: ${{ github.repository_owner == 'Armbian' }}
2324
concurrency:
2425
group: org-triage-${{ github.workflow }}-${{ github.ref }}
2526
cancel-in-progress: false

.github/workflows/community-invite-contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
jobs:
1313
check-eligibility:
1414
runs-on: ubuntu-latest
15+
if: ${{ github.repository_owner == 'Armbian' }}
1516
steps:
1617
- name: Collect PR authors from multiple Armbian repositories
1718
id: get-contributors

.github/workflows/data-update-base-files-info.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
name: "Update base-files info"
1515
runs-on: ubuntu-latest
1616
timeout-minutes: 30
17+
if: ${{ github.repository_owner == 'Armbian' }}
1718
permissions:
1819
contents: write
1920
steps:

.github/workflows/data-update-download-index.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
Webindex:
2020
name: "Generate JSON Index"
2121
runs-on: ubuntu-24.04
22+
if: ${{ github.repository_owner == 'Armbian' }}
2223

2324
env:
2425
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/data-update-image-info.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
update-image-info:
1818
name: Update image info data
1919
runs-on: super
20+
if: ${{ github.repository_owner == 'Armbian' }}
2021
steps:
2122

2223
- name: Fix workspace permissions

.github/workflows/data-update-jira-excerpt.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
jira:
1313
runs-on: ubuntu-24.04
1414
name: "Get from Armbian Jira"
15+
if: ${{ github.repository_owner == 'Armbian' }}
1516
permissions:
1617
contents: write
1718
env:

.github/workflows/data-update-partners-data.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ jobs:
1212
fetch-bigin-data:
1313
runs-on: ubuntu-latest
1414
name: "Fetch data"
15+
if: ${{ github.repository_owner == 'Armbian' }}
16+
permissions:
17+
contents: write
1518
steps:
1619
- name: Checkout armbian.github.io repository
1720
uses: actions/checkout@v6
@@ -109,7 +112,7 @@ jobs:
109112
mkdir -p data/
110113
cp ${{ github.workspace }}/*.json data/
111114
git config user.name "github-actions[bot]"
112-
git config --global user.email "github-actions@github.com"
115+
git config user.email "github-actions[bot]@users.noreply.github.com"
113116
git add data/platinum-partner.json data/gold-partner.json data/silver-partner.json data/maintainers.json
114117
git commit -m "Update of Bigin sourced JSON files" || echo "No changes to commit"
115118
git push

.github/workflows/data-update-rpi-imager-json.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717

1818
name: "Generate JSON Index"
1919
runs-on: "ubuntu-24.04"
20+
if: ${{ github.repository_owner == 'Armbian' }}
21+
permissions:
22+
contents: write
2023
steps:
2124

2225
- name: Checkout build framework repository
@@ -132,8 +135,8 @@ jobs:
132135
133136
cp ${{ github.workspace }}/rpi-imager.json data/
134137
135-
git config --global user.name "github-actions"
136-
git config --global user.email "github-actions@github.com"
138+
git config user.name "github-actions[bot]"
139+
git config user.email "github-actions[bot]@users.noreply.github.com"
137140
git add data/.
138-
git diff --cached --quiet || git commit -m "Update WEB indes files"
141+
git diff --cached --quiet || git commit -m "Update WEB index files"
139142
git push

.github/workflows/generate-servers-jsons.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
generate:
1313
name: "Generate JSON from NetBox"
1414
runs-on: ubuntu-24.04
15+
if: ${{ github.repository_owner == 'Armbian' }}
1516

1617
env:
1718
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)