Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false

- name: Show disk usage
uses: ./.github/actions/disk-usage
Expand Down Expand Up @@ -65,6 +66,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false

- name: Setup Gradle environment
uses: ./.github/actions/setup-gradle
Expand All @@ -82,6 +84,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false

- name: Setup Gradle environment
uses: ./.github/actions/setup-gradle
Expand All @@ -103,6 +106,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false

- name: Setup Gradle environment
uses: ./.github/actions/setup-gradle
Expand All @@ -120,6 +124,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false

- name: Setup Gradle environment
uses: ./.github/actions/setup-gradle
Expand All @@ -145,6 +150,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false

- name: Setup Gradle environment
uses: ./.github/actions/setup-gradle
Expand All @@ -162,6 +168,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false

- name: Setup Gradle environment
uses: ./.github/actions/setup-gradle
Expand All @@ -179,6 +186,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false

- name: Setup Gradle environment
uses: ./.github/actions/setup-gradle
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-cli-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false

- name: Setup Gradle environment
uses: ./.github/actions/setup-gradle
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/build-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ jobs:
build-daily:
if: ${{ github.repository_owner == 'thunderbird' }}
uses: ./.github/workflows/shippable_builds.yml
secrets: inherit
secrets:
MATRIX_NOTIFY_TOKEN: ${{ secrets.MATRIX_NOTIFY_TOKEN }}
BOT_PRIVATE_KEY: ${{ secrets.BOT_PRIVATE_KEY }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
PLAY_STORE_ACCOUNT: ${{ secrets.PLAY_STORE_ACCOUNT }}
permissions:
id-token: write # For GCS publishing (ftp.mo)
contents: read
1 change: 1 addition & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
token: ${{ steps.app-token.outputs.token || github.token }}
persist-credentials: false

- name: Cargo cache
uses: actions-rust-lang/setup-rust-toolchain@2b1f5e9b395427c92ee4e3331786ca3c37afe2d7 # v1.16.0
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false

- name: Setup Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # @v6.2.0
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/pr-auto-assign-reviewer.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
---
name: PR - Auto Assign Reviewer

# Warning, this job is running on pull_request_target and therefore has access to issue content.
# Don't add any steps that act on external code.
on:
# This workflow uses pull_request_target so it has access to secrets and write
# permissions even for fork PRs, which is required to assign reviewers.
#
# Security constraints that must be maintained to prevent code injection:
# - Do not checkout or execute any code.
# - Do not interpolate free-form PR fields.

on: # zizmor: ignore[dangerous-triggers]
pull_request_target:
types: [review_requested]

Expand Down Expand Up @@ -32,4 +37,4 @@ jobs:
PR_NUMBER: ${{ github.event.pull_request.number }}
GH_TOKEN: ${{ steps.app-token.outputs.token || github.token }}
run: |
gh pr edit $PR_NUMBER --repo $GITHUB_REPOSITORY --add-assignee "$PR_REVIEWER"
gh pr edit "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --add-assignee "$PR_REVIEWER"
10 changes: 6 additions & 4 deletions .github/workflows/pr-dependabot-dependency-guard-update.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
name: PR - Update dependency guard for Dependabot PRs

# Warning, this job is running on pull_request_target and therefore has access to issue content.
# Don't add any steps that act on external code.
# This workflow uses pull_request (not pull_request_target) because it only runs
# on same-repo dependabot PRs, guarded by head.repo.full_name. Same-repo PRs have
# write permissions and secret access without needing pull_request_target.
on:
pull_request_target:
pull_request:
types:
- opened
- synchronize
Expand All @@ -26,7 +27,7 @@ permissions:

jobs:
pr-update-dependency-guard:
if: github.actor == 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == 'thunderbird/thunderbird-android'
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == 'thunderbird/thunderbird-android'
runs-on: ubuntu-latest
environment: botmobile
timeout-minutes: 90
Expand All @@ -44,6 +45,7 @@ jobs:
with:
ref: ${{ github.head_ref }}
token: ${{ steps.app-token.outputs.token || github.token }}
persist-credentials: false

- name: Setup Gradle environment
uses: ./.github/actions/setup-gradle
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/pr-label-tb-team.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
---
name: PR - Label tb-team

# Warning, this job is running on pull_request_target and therefore has access to issue content.
# Don't add any steps that act on external code.
on:
# This workflow uses pull_request_target so it has access to secrets and write
# permissions even for fork PRs, which is required to add labels.
#
# Security constraints that must be maintained to prevent code injection:
# - Do not checkout or execute any code.
# - Do not interpolate free-form PR fields.

on: # zizmor: ignore[dangerous-triggers]
pull_request_target:
types: [opened, reopened]

Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/pr-merged.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
---
name: PR - Merged

# Warning, this job is running on pull_request_target and therefore has access to issue content.
# Don't add any steps that act on external code.
on:
# This workflow uses pull_request_target so it has access to secrets and write
# permissions even for fork PRs, which is required to post comments and set milestones.
#
# Security constraints that must be maintained to prevent code injection:
# - Do not checkout or execute any code.
# - Do not interpolate free-form PR fields.

on: # zizmor: ignore[dangerous-triggers]
pull_request_target:
branches: [main, beta, release]
types: [closed]
Expand Down Expand Up @@ -33,19 +38,19 @@ jobs:
GH_TOKEN: ${{ steps.app-token.outputs.token || github.token }}
run: |
# There should be exactly 3 milestones open at all times
TARGET_BRANCH="${{ github.base_ref }}"
TARGET_BRANCH="${GITHUB_BASE_REF}"
case "$TARGET_BRANCH" in
main) milestone_index=0 ;;
beta) milestone_index=1 ;;
release) milestone_index=2 ;;
esac
echo "$milestone_index"
gh api repos/$GITHUB_REPOSITORY/milestones --jq "
gh api "repos/$GITHUB_REPOSITORY/milestones" --jq "
map(select(.state == \"open\" and .due_on != null))
| sort_by(.due_on) | reverse
| .[${milestone_index}] | { number, title }
| to_entries
| map(.key + \"=\" + (.value|tostring)) | join(\"\n\")" | tee -a $GITHUB_OUTPUT
| map(.key + \"=\" + (.value|tostring)) | join(\"\n\")" | tee -a "$GITHUB_OUTPUT"

- name: Thank you
if: |
Expand All @@ -67,12 +72,12 @@ jobs:

Hope to see you there! 🚀📱🐦
run: |
gh pr comment $PR_NUMBER --repo $GITHUB_REPOSITORY --body "$MESSAGE"
gh pr comment "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --body "$MESSAGE"

- name: Set active milestone on PR
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GH_TOKEN: ${{ steps.app-token.outputs.token || github.token }}
MILESTONE: ${{ steps.milestone.outputs.number }}
run: |
gh api --method PATCH /repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER -f milestone=$MILESTONE
gh api --method PATCH "/repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER" -f "milestone=$MILESTONE"
12 changes: 8 additions & 4 deletions .github/workflows/pr-opened.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
---
name: PR - Opened

# Warning, this job is running on pull_request_target and therefore has access to issue content.
# Don't add any steps that act on external code.
on:
# This workflow uses pull_request_target so it has access to secrets and write
# permissions even for fork PRs, which is required to post comments.
#
# Security constraints that must be maintained to prevent code injection:
# - Do not checkout or execute any code.
# - Do not interpolate free-form PR fields.

on: # zizmor: ignore[dangerous-triggers]
pull_request_target:
branches: [beta, release]
types: [opened]
Expand All @@ -30,7 +35,6 @@ jobs:
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GH_TOKEN: ${{ steps.app-token.outputs.token || github.token }}
MILESTONE: ${{ steps.milestone.outputs.title }}
MESSAGE: |
Thank you for your uplift request! Please add a comment with the following approval request template filled out.

Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/pr-request-report-labels.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
---
name: PR - Request report labels

# Warning, this job is running on pull_request_target and therefore has access to issue content.
# Don't add any steps that act on external code.
on:
# This workflow uses pull_request_target so it has access to secrets and write
# permissions even for fork PRs, which is required to post comments and add labels.
#
# Security constraints that must be maintained to prevent code injection:
# - Do not checkout or execute any code.
# - Do not interpolate free-form PR fields.

on: # zizmor: ignore[dangerous-triggers]
pull_request_target:
types: [ opened, reopened, synchronize, labeled, unlabeled ]
branches:
Expand All @@ -23,10 +28,13 @@ jobs:
steps:
- name: Validate report label
id: validate
env:
LABELS_JSON: ${{ toJson(github.event.pull_request.labels) }}
PR_BODY: ${{ toJson(github.event.pull_request.body) }}
run: |
set -euo pipefail

labels_json='${{ toJson(github.event.pull_request.labels) }}'
labels_json="$LABELS_JSON"

echo "Current labels:"
echo "$labels_json" | jq -r '.[].name'
Expand All @@ -47,7 +55,7 @@ jobs:

feature_flag_count="$(jq '[.[] | select(.name == "feature flag")] | length' <<< "$labels_json")"
if [ "$feature_flag_count" -gt 0 ]; then
pr_body='${{ toJson(github.event.pull_request.body) }}'
pr_body="$PR_BODY"
pr_feature_flag_key="$(jq -nr --arg body "$pr_body" 'try ($body | gsub("\r"; "") | capture("(?m)^feature-flag:\\s*`(?<flag>[^`]+)`$").flag) catch ""')"
if [ -z "$pr_feature_flag_key" ]; then
echo "valid=false" >> "$GITHUB_OUTPUT"
Expand All @@ -64,10 +72,11 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO: ${{ github.repository }}
MESSAGE: ${{ steps.validate.outputs.message }}
run: |
gh pr comment "$PR_NUMBER" \
--repo "${{ github.repository }}" \
--repo "$REPO" \
--body "$MESSAGE"

- name: Fail if invalid
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/quality-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false

- name: Setup Gradle environment
uses: ./.github/actions/setup-gradle
Expand All @@ -51,6 +52,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false

- name: Setup Gradle environment
uses: ./.github/actions/setup-gradle
Expand All @@ -77,6 +79,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false

- name: Setup Gradle environment
uses: ./.github/actions/setup-gradle
Expand All @@ -94,6 +97,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false

- name: Setup Gradle environment
uses: ./.github/actions/setup-gradle
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/quality-markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Cargo cache
uses: actions-rust-lang/setup-rust-toolchain@2b1f5e9b395427c92ee4e3331786ca3c37afe2d7 # v1.16.0
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/security-codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Setup Gradle environment
if: matrix.language == 'java-kotlin'
Expand Down
Loading
Loading