Skip to content

Commit f9332bc

Browse files
Merge pull request #931 from nextcloud/repo-sync/android-config/main
🔄 synced file(s) with nextcloud/android-config
2 parents 9086615 + 2cc0bc7 commit f9332bc

26 files changed

Lines changed: 1716 additions & 1028 deletions

.drone.yml

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -45,56 +45,7 @@ steps:
4545
branch:
4646
- master
4747
---
48-
kind: pipeline
49-
name: analysis
50-
51-
steps:
52-
- name: analysis
53-
image: ghcr.io/nextcloud/continuous-integration-android8:4
54-
environment:
55-
GIT_USERNAME:
56-
from_secret: GIT_USERNAME
57-
GIT_TOKEN:
58-
from_secret: GIT_TOKEN
59-
LOG_USERNAME:
60-
from_secret: LOG_USERNAME
61-
LOG_PASSWORD:
62-
from_secret: LOG_PASSWORD
63-
commands:
64-
- scripts/checkIfRunDrone.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST || exit 0
65-
- export BRANCH=$(scripts/analysis/getBranchName.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST)
66-
- scripts/analysis/analysis-wrapper.sh $GIT_USERNAME $GIT_TOKEN $BRANCH $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER $DRONE_PULL_REQUEST
67-
68-
- name: notify
69-
image: drillster/drone-email
70-
settings:
71-
port: 587
72-
from: nextcloud-drone@kaminsky.me
73-
recipients_only: true
74-
username:
75-
from_secret: EMAIL_USERNAME
76-
password:
77-
from_secret: EMAIL_PASSWORD
78-
recipients:
79-
from_secret: EMAIL_RECIPIENTS
80-
host:
81-
from_secret: EMAIL_HOST
82-
when:
83-
event:
84-
- push
85-
status:
86-
- failure
87-
branch:
88-
- master
89-
90-
trigger:
91-
branch:
92-
- master
93-
event:
94-
- push
95-
- pull_request
96-
---
9748
kind: signature
98-
hmac: 89c97c7ee551bee0d6991c56f8673c0cb04478fa87eb9f2dc88d93710fc67f77
49+
hmac: 3853a8f64ae3aeef0f118c1b9d1a4b29af32f744dc32f608a7020dabd31d4a0b
9950

10051
...

.github/workflows/analysis.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# synced from @nextcloud/android-config
2+
3+
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
4+
# SPDX-FileCopyrightText: 2025 Alper Ozturk <alper.ozturk@nextcloud.com>
5+
# SPDX-FileCopyrightText: 2023 Tobias Kaminsky <tobias@kaminsky.me>
6+
# SPDX-FileCopyrightText: 2023 Andy Scherzinger <info@andy-scherzinger.de>
7+
# SPDX-FileCopyrightText: 2023 Josh Richards <josh.t.richards@gmail.com>
8+
# SPDX-FileCopyrightText: 2025 Marcel Hibbe <dev@mhibbe.de>
9+
# SPDX-License-Identifier: GPL-3.0-or-later
10+
11+
name: "Analysis"
12+
13+
on:
14+
pull_request:
15+
branches: [ "master", "main", "stable-*" ]
16+
push:
17+
branches: [ "master", "main", "stable-*" ]
18+
19+
permissions:
20+
pull-requests: write
21+
contents: write
22+
23+
concurrency:
24+
group: analysis-wrapper-${{ github.head_ref || github.run_id }}
25+
cancel-in-progress: true
26+
27+
jobs:
28+
analysis:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Disabled on forks
32+
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }}
33+
run: |
34+
echo 'Can not analyze PRs from forks'
35+
exit 1
36+
- name: Setup variables # zizmor: ignore[template-injection]
37+
id: get-vars
38+
run: |
39+
if [ -z "$GITHUB_HEAD_REF" ]; then
40+
# push
41+
{
42+
echo "branch=$GITHUB_REF_NAME"
43+
echo "pr=$GITHUB_RUN_ID"
44+
echo "repo=${{ github.repository }}"
45+
} >> "$GITHUB_OUTPUT"
46+
else
47+
# pull request
48+
{
49+
echo "branch=$GITHUB_HEAD_REF"
50+
echo "pr=${{ github.event.pull_request.number }}"
51+
echo "repo=${{ github.event.pull_request.head.repo.full_name }}"
52+
} >> "$GITHUB_OUTPUT"
53+
fi
54+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
55+
with:
56+
persist-credentials: false
57+
repository: ${{ steps.get-vars.outputs.repo }}
58+
ref: ${{ steps.get-vars.outputs.branch }}
59+
- name: Set up JDK 17
60+
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
61+
with:
62+
distribution: "temurin"
63+
java-version: 17
64+
- name: Install dependencies
65+
run: |
66+
sudo apt install python3-defusedxml
67+
- name: Run analysis wrapper
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
run: |
71+
mkdir -p "$HOME/.gradle"
72+
{
73+
echo "org.gradle.jvmargs=-Xmx1g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"
74+
echo "org.gradle.configureondemand=true"
75+
echo "kapt.incremental.apt=true"
76+
} > "$HOME/.gradle/gradle.properties"
77+
scripts/analysis/analysis-wrapper.sh "${{ steps.get-vars.outputs.branch }}" "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" "$GITHUB_RUN_NUMBER" "${{ steps.get-vars.outputs.pr }}"
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# synced from @nextcloud/android-config
2+
3+
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
4+
# SPDX-FileCopyrightText: 2023 Álvaro Brey <alvaro@alvarobrey.com>
5+
# SPDX-License-Identifier: GPL-3.0-or-later
6+
7+
name: Auto approve sync
8+
on:
9+
pull_request_target: # zizmor: ignore[dangerous-triggers]
10+
branches:
11+
- master
12+
- main
13+
types:
14+
- opened
15+
- reopened
16+
- synchronize
17+
- labeled
18+
19+
concurrency:
20+
group: sync-approve-${{ github.head_ref || github.run_id }}
21+
cancel-in-progress: true
22+
23+
permissions:
24+
pull-requests: write
25+
26+
jobs:
27+
auto-approve:
28+
name: Auto approve sync
29+
runs-on: ubuntu-latest
30+
if: ${{ contains(github.event.pull_request.labels.*.name, 'sync') && github.actor == 'nextcloud-android-bot' }}
31+
steps:
32+
- name: Disabled on forks
33+
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
34+
run: |
35+
echo 'Can not approve PRs from forks'
36+
exit 1
37+
38+
- uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0
39+
with:
40+
github-token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/check.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
2+
# SPDX-FileCopyrightText: 2017 Tobias Kaminsky <tobias@kaminsky.me>
3+
# SPDX-License-Identifier: GPL-3.0-or-later
4+
name: Check
5+
6+
on:
7+
pull_request:
8+
branches: [ master, stable-* ]
9+
push:
10+
branches: [ master, stable-* ]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
check:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
task: [ lib:detekt, lib:spotlessKotlinCheck, lib:lint ]
22+
steps:
23+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
24+
- name: Set up JDK 17
25+
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
26+
with:
27+
distribution: "temurin"
28+
java-version: 17
29+
- name: Setup JVM options
30+
run: |
31+
mkdir -p "$HOME/.gradle"
32+
echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > "$HOME/.gradle/gradle.properties"
33+
- name: Check ${{ matrix.task }}
34+
uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3.5.0
35+
with:
36+
arguments: ${{ matrix.task }}
37+
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
38+
if: ${{ always() }}
39+
with:
40+
name: ${{ matrix.task }}-report
41+
path: library/build/reports

.github/workflows/codeql.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# synced from @nextcloud/android-config
2+
3+
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
4+
# SPDX-FileCopyrightText: 2023-2024 Andy Scherzinger <info@andy-scherzinger.de>
5+
# SPDX-FileCopyrightText: 2022 Tobias Kaminsky <tobias@kaminsky.me>
6+
# SPDX-FileCopyrightText: 2022 Álvaro Brey <alvaro@alvarobrey.com>
7+
# SPDX-FileCopyrightText: 2025 Marcel Hibbe <dev@mhibbe.de>
8+
# SPDX-License-Identifier: GPL-3.0-or-later
9+
10+
name: "CodeQL"
11+
12+
on:
13+
push:
14+
branches: [ "master", "main", "stable-*" ]
15+
pull_request:
16+
branches: [ "master", "main" ]
17+
schedule:
18+
- cron: '24 18 * * 3'
19+
20+
permissions:
21+
contents: read
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
language: [ 'java' ]
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
38+
with:
39+
persist-credentials: false
40+
- name: Set Swap Space
41+
if: runner.environment == 'github-hosted'
42+
uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c # v1.0
43+
with:
44+
swap-size-gb: 10
45+
- name: Initialize CodeQL
46+
uses: github/codeql-action/init@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10
47+
with:
48+
languages: ${{ matrix.language }}
49+
- name: Set up JDK 17
50+
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
51+
with:
52+
distribution: "temurin"
53+
java-version: 17
54+
- name: Assemble
55+
run: |
56+
mkdir -p "$HOME/.gradle"
57+
echo "org.gradle.jvmargs=-Xmx3g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > "$HOME/.gradle/gradle.properties"
58+
./gradlew --no-daemon assembleDebug
59+
- name: Perform CodeQL Analysis
60+
uses: github/codeql-action/analyze@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# synced from @nextcloud/android-config
2+
3+
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
4+
# SPDX-FileCopyrightText: 2023 Andy Scherzinger <info@andy-scherzinger.de>
5+
# SPDX-FileCopyrightText: 2022 Tobias Kaminsky <tobias@kaminsky.me>
6+
# SPDX-FileCopyrightText: 2022 Álvaro Brey <alvaro@alvarobrey.com>
7+
# SPDX-License-Identifier: GPL-3.0-or-later
8+
9+
name: "Detect new java files"
10+
11+
on:
12+
pull_request:
13+
branches: [ master, main, stable-* ]
14+
15+
permissions: read-all
16+
17+
concurrency:
18+
group: detect-new-java-files-${{ github.head_ref || github.run_id }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
detectNewJavaFiles:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- id: file_changes
26+
uses: trilom/file-changes-action@a6ca26c14274c33b15e6499323aac178af06ad4b # v1.2.4
27+
with:
28+
output: ','
29+
- name: Detect new java files
30+
run: |
31+
if [ -z '${{ steps.file_changes.outputs.files_added }}' ]; then
32+
echo "No new files added"
33+
exit 0
34+
fi
35+
new_java=$(echo '${{ steps.file_changes.outputs.files_added }}' | tr ',' '\n' | grep '\.java$' | cat)
36+
if [ -n "$new_java" ]; then
37+
# shellcheck disable=SC2016
38+
printf 'New java files detected:\n```\n%s\n```\n' "$new_java" | tee "$GITHUB_STEP_SUMMARY"
39+
exit 1
40+
else
41+
echo "No new java files detected"
42+
exit 0
43+
fi

.github/workflows/pr-feedback.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
6+
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-FileCopyrightText: 2023 Marcel Klehr <mklehr@gmx.net>
8+
# SPDX-FileCopyrightText: 2023 Joas Schilling <213943+nickvergessen@users.noreply.github.com>
9+
# SPDX-FileCopyrightText: 2023 Daniel Kesselberg <mail@danielkesselberg.de>
10+
# SPDX-FileCopyrightText: 2023 Florian Steffens <florian.steffens@nextcloud.com>
11+
# SPDX-License-Identifier: MIT
12+
13+
name: 'Ask for feedback on PRs'
14+
on:
15+
schedule:
16+
- cron: '30 1 * * *'
17+
18+
permissions:
19+
contents: read
20+
pull-requests: write
21+
22+
jobs:
23+
pr-feedback:
24+
if: ${{ github.repository_owner == 'nextcloud' }}
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: The get-github-handles-from-website action
28+
uses: marcelklehr/get-github-handles-from-website-action@06b2239db0a48fe1484ba0bfd966a3ab81a08308 # v1.0.1
29+
id: scrape
30+
with:
31+
website: 'https://nextcloud.com/team/'
32+
33+
- name: Get blocklist
34+
id: blocklist
35+
run: |
36+
blocklist=$(curl https://raw.githubusercontent.com/nextcloud/.github/master/non-community-usernames.txt | paste -s -d, -)
37+
echo "blocklist=$blocklist" >> "$GITHUB_OUTPUT"
38+
39+
- uses: nextcloud/pr-feedback-action@5227c55be184087d0aef6338bee210d8620b6297 # main
40+
with:
41+
feedback-message: |
42+
Hello there,
43+
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.
44+
45+
We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.
46+
47+
Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6
48+
49+
Thank you for contributing to Nextcloud and we hope to hear from you soon!
50+
51+
(If you believe you should not receive this message, you can add yourself to the [blocklist](https://github.com/nextcloud/.github/blob/master/non-community-usernames.txt).)
52+
days-before-feedback: 14
53+
start-date: '2024-04-30'
54+
exempt-authors: '${{ steps.blocklist.outputs.blocklist }},${{ steps.scrape.outputs.users }}'
55+
exempt-bots: true

0 commit comments

Comments
 (0)