Skip to content

Commit db654c2

Browse files
committed
ci: replace secrets inherit with explicit secret passing
Pass only required secrets to reusable workflows instead of inheriting all secrets. Adds secret declarations to reusable workflows.
1 parent 26f351d commit db654c2

6 files changed

Lines changed: 31 additions & 6 deletions

File tree

.github/workflows/__automation.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Automation 🎛️
22

33
on:
44
workflow_call:
5+
secrets:
6+
JF_BOT_TOKEN:
7+
required: true
58

69
jobs:
710
conflicts:

.github/workflows/__deploy.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ name: Deploy 🏗️
22

33
on:
44
workflow_call:
5+
secrets:
6+
CLOUDFLARE_API_TOKEN:
7+
required: true
8+
CLOUDFLARE_ACCOUNT_ID:
9+
required: true
10+
JF_BOT_TOKEN:
11+
required: true
512
inputs:
613
branch:
714
required: true
@@ -57,7 +64,8 @@ jobs:
5764
# Always run so the comment is composed for the workflow summary
5865
if: ${{ always() }}
5966
uses: ./.github/workflows/__job_messages.yml
60-
secrets: inherit
67+
secrets:
68+
JF_BOT_TOKEN: ${{ secrets.JF_BOT_TOKEN }}
6169
needs:
6270
- cf-pages
6371

.github/workflows/__job_messages.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Job messages ⚙️
22

33
on:
44
workflow_call:
5+
secrets:
6+
JF_BOT_TOKEN:
7+
required: true
58
inputs:
69
branch:
710
required: false

.github/workflows/ci-deploy.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ jobs:
3737
name: Deploy 🚀
3838
needs: get-pr-number
3939
uses: ./.github/workflows/__deploy.yml
40-
secrets: inherit
40+
secrets:
41+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
42+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
43+
JF_BOT_TOKEN: ${{ secrets.JF_BOT_TOKEN }}
4144
with:
4245
branch: ${{ github.event.workflow_run.head_repository.full_name != github.repository && github.event.workflow_run.head_branch == 'master' && format('{0}/{1}', github.event.workflow_run.head_repository.full_name, github.event.workflow_run.head_branch) || github.event.workflow_run.head_branch }}
4346
commit: ${{ github.event.workflow_run.head_sha }}

.github/workflows/pull_request.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ jobs:
1818
name: Automation 🎛️
1919
if: ${{ github.event_name == 'pull_request_target' && github.repository == 'jellyfin/jellyfin-web' }}
2020
uses: ./.github/workflows/__automation.yml
21-
secrets: inherit
21+
secrets:
22+
JF_BOT_TOKEN: ${{ secrets.JF_BOT_TOKEN }}
2223

2324
merge-queue-build:
2425
name: Build 🏗️
@@ -55,7 +56,10 @@ jobs:
5556
permissions:
5657
contents: read
5758
deployments: write
58-
secrets: inherit
59+
secrets:
60+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
61+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
62+
JF_BOT_TOKEN: ${{ secrets.JF_BOT_TOKEN }}
5963
with:
6064
branch: ${{ github.head_ref }}
6165
commit: ${{ github.sha }}

.github/workflows/push.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ jobs:
1717
name: Automation 🎛️
1818
if: ${{ github.repository == 'jellyfin/jellyfin-web' }}
1919
uses: ./.github/workflows/__automation.yml
20-
secrets: inherit
20+
secrets:
21+
JF_BOT_TOKEN: ${{ secrets.JF_BOT_TOKEN }}
2122

2223
main:
2324
name: 'Unstable release 🚀⚠️'
@@ -52,7 +53,10 @@ jobs:
5253
permissions:
5354
contents: read
5455
deployments: write
55-
secrets: inherit
56+
secrets:
57+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
58+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
59+
JF_BOT_TOKEN: ${{ secrets.JF_BOT_TOKEN }}
5660
with:
5761
branch: ${{ github.ref_name }}
5862
comment: false

0 commit comments

Comments
 (0)