Skip to content

Commit 7e8a27f

Browse files
🔄 synced local '.github/workflows/' with remote 'config/workflows/'
Signed-off-by: nextcloud-android-bot <[email protected]>
1 parent 4a77016 commit 7e8a27f

File tree

8 files changed

+418
-0
lines changed

8 files changed

+418
-0
lines changed

.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 <[email protected]>
5+
# SPDX-FileCopyrightText: 2023 Tobias Kaminsky <[email protected]>
6+
# SPDX-FileCopyrightText: 2023 Andy Scherzinger <[email protected]>
7+
# SPDX-FileCopyrightText: 2023 Josh Richards <[email protected]>
8+
# SPDX-FileCopyrightText: 2025 Marcel Hibbe <[email protected]>
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
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 <[email protected]>
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/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 <[email protected]>
5+
# SPDX-FileCopyrightText: 2022 Tobias Kaminsky <[email protected]>
6+
# SPDX-FileCopyrightText: 2022 Álvaro Brey <[email protected]>
7+
# SPDX-FileCopyrightText: 2025 Marcel Hibbe <[email protected]>
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
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 <[email protected]>
5+
# SPDX-FileCopyrightText: 2022 Tobias Kaminsky <[email protected]>
6+
# SPDX-FileCopyrightText: 2022 Álvaro Brey <[email protected]>
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 <[email protected]>
8+
# SPDX-FileCopyrightText: 2023 Joas Schilling <[email protected]>
9+
# SPDX-FileCopyrightText: 2023 Daniel Kesselberg <[email protected]>
10+
# SPDX-FileCopyrightText: 2023 Florian Steffens <[email protected]>
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
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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: Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
8+
9+
name: Auto approve renovate PRs
10+
11+
on:
12+
pull_request_target: # zizmor: ignore[dangerous-triggers]
13+
branches:
14+
- main
15+
- master
16+
- stable*
17+
18+
permissions:
19+
contents: read
20+
21+
concurrency:
22+
group: renovate-approve-merge-${{ github.head_ref || github.run_id }}
23+
cancel-in-progress: true
24+
25+
jobs:
26+
auto-approve-merge:
27+
if: github.event.pull_request.user.login == 'renovate[bot]'
28+
runs-on: ubuntu-latest
29+
permissions:
30+
# for hmarr/auto-approve-action to approve PRs
31+
pull-requests: write
32+
33+
steps:
34+
- name: Disabled on forks
35+
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
36+
run: |
37+
echo 'Can not approve PRs from forks'
38+
exit 1
39+
40+
- uses: mdecoleman/pr-branch-name@55795d86b4566d300d237883103f052125cc7508 # v3.0.0
41+
id: branchname
42+
with:
43+
repo-token: ${{ secrets.GITHUB_TOKEN }}
44+
45+
# GitHub actions bot approve
46+
- uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0
47+
if: github.actor == 'renovate[bot]'
48+
with:
49+
github-token: ${{ secrets.GITHUB_TOKEN }}
50+
51+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
52+
with:
53+
ref: ${{ github.head_ref }}
54+
55+
# Enable GitHub auto merge
56+
- name: Enable Pull Request Automerge
57+
if: github.actor == 'renovate[bot]'
58+
run: gh pr merge --merge --auto
59+
env:
60+
GH_TOKEN: ${{ secrets.AUTOMERGE }}
61+

.github/workflows/scorecard.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# synced from @nextcloud/android-config
2+
3+
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
4+
# SPDX-FileCopyrightText: 2023 Andy Scherzinger <[email protected]>
5+
# SPDX-License-Identifier: GPL-3.0-or-later
6+
7+
name: Scorecard supply-chain security
8+
on:
9+
branch_protection_rule:
10+
schedule:
11+
- cron: '32 23 * * 4'
12+
push:
13+
branches: [ "main", "master" ]
14+
15+
# Declare default permissions as read only.
16+
permissions: read-all
17+
18+
concurrency:
19+
group: scorecard-supply-chain-security-${{ github.head_ref || github.run_id }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
analysis:
24+
name: Scorecard analysis
25+
runs-on: ubuntu-latest
26+
permissions:
27+
# Needed to upload the results to code-scanning dashboard.
28+
security-events: write
29+
30+
steps:
31+
- name: "Checkout code"
32+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
33+
with:
34+
persist-credentials: false
35+
36+
- name: "Run analysis"
37+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
38+
with:
39+
results_file: results.sarif
40+
results_format: sarif
41+
publish_results: false
42+
43+
# Upload the results to GitHub's code scanning dashboard.
44+
- name: "Upload to code-scanning"
45+
uses: github/codeql-action/upload-sarif@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10
46+
with:
47+
sarif_file: results.sarif

0 commit comments

Comments
 (0)