Skip to content

Commit 41e2fd4

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/dynamic-destination-keystore
# Conflicts: # cloudplatform/connectivity-oauth/src/main/java/com/sap/cloud/sdk/cloudplatform/connectivity/OAuth2Options.java
2 parents c9fd388 + 432db95 commit 41e2fd4

119 files changed

Lines changed: 2199 additions & 381 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/blackduck.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ on:
55
schedule:
66
- cron: 0 23 * * *
77

8+
permissions: {}
9+
810
jobs:
911
scan:
1012
name: "Blackduck Scan"
1113
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
1216
timeout-minutes: 15
1317
steps:
1418
- uses: actions/checkout@v6
@@ -19,6 +23,8 @@ jobs:
1923

2024
notify-job:
2125
runs-on: ubuntu-latest
26+
permissions:
27+
contents: read
2228
needs: [ scan ]
2329
if: ${{ failure() && github.ref == 'refs/heads/main' }}
2430
steps:

.github/workflows/cache-maven-dependencies.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ env:
1313
jobs:
1414
update-cache:
1515
runs-on: ubuntu-latest
16+
permissions:
17+
actions: write # needed to delete caches
1618
steps:
1719
- name: "Checkout"
1820
uses: actions/checkout@v6
@@ -36,7 +38,7 @@ jobs:
3638
gh cache delete "${CACHE_ID}"
3739
done
3840
env:
39-
GH_TOKEN: ${{ secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR }}
41+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4042

4143
- name: "Cache Dependencies"
4244
uses: actions/cache/save@v5

.github/workflows/continuous-integration.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,16 @@ env:
5050
MVN_SINGLE_THREADED_ARGS: --batch-mode --no-transfer-progress --fail-at-end --show-version --threads 1
5151
MVN_SKIP_CI_PLUGINS: -DskipFormatting -Denforcer.skip -Djacoco.skip -Dmdep.analyze.skip
5252

53+
permissions: {}
54+
5355
jobs:
5456
context:
5557
name: "Collect Context"
5658
outputs:
5759
commit: ${{ steps.calculate-commit-sha.outputs.COMMIT }}
5860
runs-on: ubuntu-latest
61+
permissions:
62+
contents: read
5963
steps:
6064
- name: "Calculate Commit SHA"
6165
id: calculate-commit-sha
@@ -79,6 +83,8 @@ jobs:
7983
name: "Check Formatting"
8084
needs: [ context ]
8185
runs-on: ubuntu-latest
86+
permissions:
87+
contents: read
8288
steps:
8389
- name: "Checkout Repository"
8490
uses: actions/checkout@v6
@@ -106,6 +112,8 @@ jobs:
106112
name: "Build"
107113
needs: [ context, check-formatting ]
108114
runs-on: ubuntu-latest
115+
permissions:
116+
contents: read # upload-artifacts does not use github-token
109117
steps:
110118
- name: "Checkout repository"
111119
uses: actions/checkout@v6
@@ -160,6 +168,8 @@ jobs:
160168
name: "Test"
161169
needs: [ context, build ]
162170
runs-on: ubuntu-latest
171+
permissions:
172+
contents: read
163173
steps:
164174
- name: "Checkout repository"
165175
uses: actions/checkout@v6
@@ -202,6 +212,8 @@ jobs:
202212
static-code-analysis:
203213
needs: [ context, build ]
204214
runs-on: ubuntu-latest
215+
permissions:
216+
contents: read
205217
strategy:
206218
matrix:
207219
task:
@@ -262,6 +274,9 @@ jobs:
262274
name: "Run CodeQL Analysis"
263275
needs: [ context ]
264276
runs-on: ubuntu-latest
277+
permissions:
278+
contents: read
279+
security-events: write # needed for Perform CodeQL Analysis
265280
steps:
266281
- name: "Checkout repository"
267282
uses: actions/checkout@v6
@@ -301,6 +316,8 @@ jobs:
301316
test-archetypes:
302317
runs-on: ubuntu-latest
303318
needs: [ context, build ]
319+
permissions:
320+
contents: read
304321
strategy:
305322
matrix:
306323
task:
@@ -396,6 +413,8 @@ jobs:
396413
if: ${{ github.event.inputs.run-blackduck-scan == 'true' }}
397414
needs: [ context ]
398415
runs-on: ubuntu-latest
416+
permissions:
417+
contents: read
399418
steps:
400419
- name: "Checkout repository"
401420
uses: actions/checkout@v6
@@ -412,6 +431,8 @@ jobs:
412431
if: ${{ github.event.inputs.run-security-rating == 'true' }}
413432
needs: [ context ]
414433
runs-on: ubuntu-latest
434+
permissions:
435+
contents: write # needed for Run FOSStars Rating
415436
steps:
416437
- name: "Checkout repository"
417438
uses: actions/checkout@v6

.github/workflows/dependabot-automerge.yaml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,22 @@ jobs:
1515
review-prs:
1616
runs-on: ubuntu-latest
1717
permissions:
18-
pull-requests: write
19-
contents: write
18+
contents: read # all write operations use app token
2019
steps:
2120
- name: Checkout
2221
uses: actions/checkout@v6
2322

23+
- name: 'Create GitHub App Token'
24+
id: app-token
25+
uses: actions/create-github-app-token@v3
26+
with:
27+
client-id: ${{ secrets.SAP_CLOUD_SDK_BOT_CLIENT_ID }}
28+
private-key: ${{ secrets.SAP_CLOUD_SDK_BOT_PRIVATE_KEY }}
29+
owner: SAP
30+
repositories: cloud-sdk-java
31+
permission-contents: write
32+
permission-pull-requests: write
33+
2434
- name: Approve and Merge PRs
2535
run: |
2636
PRS=$(gh pr list --app "dependabot" --state "open" --json number,title)
@@ -29,14 +39,14 @@ jobs:
2939
if [[ -z "$GROUP" ]]; then
3040
continue
3141
fi
32-
42+
3343
MATCHES=$(jq -r --arg group "$GROUP" '.[] | select(.title | contains($group)) | .number' <<< "$PRS")
3444
echo "[DEBUG] Found PRs for group '$GROUP': '$MATCHES'"
35-
45+
3646
PR_NUMBERS="$MATCHES"$'\n'"$PR_NUMBERS"
3747
done <<< "${{ env.DEPENDABOT_GROUPS }}"
3848
echo "[DEBUG] Approving and Merging following PRs: '$PR_NUMBERS'"
39-
49+
4050
while IFS= read -r PR_NUMBER; do
4151
if [[ -z "$PR_NUMBER" ]]; then
4252
continue
@@ -47,4 +57,4 @@ jobs:
4757
gh pr review "$PR_NUMBER" --approve
4858
done <<< "$PR_NUMBERS"
4959
env:
50-
GH_TOKEN: ${{ secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR }}
60+
GH_TOKEN: ${{ steps.app-token.outputs.token }}

.github/workflows/deploy-snapshot.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ jobs:
99
deploy-snapshot:
1010
name: Deploy Snapshot
1111
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
1214
steps:
1315
- name: "Checkout Repository"
1416
uses: actions/checkout@v6
@@ -39,7 +41,7 @@ jobs:
3941

4042
- name: 'Slack Notification'
4143
if: failure()
42-
uses: slackapi/slack-github-action@v3.0.1
44+
uses: slackapi/slack-github-action@v3.0.3
4345
with:
4446
webhook: ${{ secrets.SLACK_WEBHOOK }}
4547
webhook-type: incoming-webhook

.github/workflows/fosstars-report.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ jobs:
88
create_fosstars_report:
99
runs-on: ubuntu-latest
1010
name: "Security rating"
11+
permissions:
12+
contents: write # needed to push to branch
1113
steps:
1214
- uses: actions/checkout@v6
1315
- uses: SAP/fosstars-rating-core-action@v1.14.0

.github/workflows/javadoc.yaml

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,60 +11,73 @@ on:
1111
env:
1212
JAVA_VERSION: 17
1313
DOCS_REPO: SAP/cloud-sdk
14-
PROJECTS: "!:rfc,!:dwc-cf,!:datamodel-metadata-generator,!:odata-generator,!:odata-generator-maven-plugin,!:odata-generator-utility,!:odata-v4-generator,!:odata-v4-generator-maven-plugin,!:s4hana-connectivity,!:soap,!:testutil,!:s4hana-core"
14+
PROJECTS: '!:rfc,!:dwc-cf,!:datamodel-metadata-generator,!:odata-generator,!:odata-generator-maven-plugin,!:odata-generator-utility,!:odata-v4-generator,!:odata-v4-generator-maven-plugin,!:s4hana-connectivity,!:soap,!:testutil,!:s4hana-core'
1515

1616
jobs:
1717
build:
18-
name: "JavaDoc to Documentation Portal"
18+
name: 'JavaDoc to Documentation Portal'
1919
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read # all write operations use app token
2022

2123
steps:
22-
- name: "Prepare git"
24+
- name: 'Prepare git'
2325
run: |
2426
git config --global user.email "cloudsdk@sap.com"
2527
git config --global user.name "SAP Cloud SDK Bot"
2628
27-
- name: "Checkout Repository"
29+
- name: 'Checkout Repository'
2830
uses: actions/checkout@v6
2931
with:
3032
fetch-depth: 0
31-
32-
- name: "Switch branch"
33+
34+
- name: 'Switch branch'
3335
run: git checkout "${{ github.event.inputs.branch || 'main' }}"
3436

35-
- name: "Set up JDK 17"
37+
- name: 'Set up JDK 17'
3638
uses: actions/setup-java@v5
3739
with:
3840
java-version: '17'
3941
distribution: 'temurin'
4042
cache: 'maven'
4143

42-
- name: "Determine Versions"
44+
- name: 'Determine Versions'
4345
id: determine-version
4446
run: |
4547
echo "MAJOR_VERSION=$(jq -r '.version' latest.json | cut -d '.' -f 1)" >> $GITHUB_OUTPUT
4648
echo "CURRENT_VERSION=$(jq -r '.version' latest.json)" >> $GITHUB_OUTPUT
4749
48-
- name: "Install project (skip tests)"
50+
- name: 'Install project (skip tests)'
4951
run: mvn install -DskipTests --quiet
5052

51-
- name: "Process sources"
53+
- name: 'Process sources'
5254
run: mvn process-sources -Drelease --fail-at-end --projects "${PROJECTS}" --quiet
5355

54-
- name: "Copy delombok sources"
56+
- name: 'Copy delombok sources'
5557
run: find . -type d -path "*/target/delombok" -exec sh -c 'cp -r "$1"/* "$(dirname $(dirname "$1"))/src/main/java/"' _ {} \;
5658

57-
- name: "Generate aggregated Javadoc"
59+
- name: 'Generate aggregated Javadoc'
5860
run: mvn clean javadoc:aggregate -Drelease -Djava.failOnWarning=false --projects "${PROJECTS}" --quiet
5961

60-
- name: "Checkout Docs Repository"
62+
- name: 'Create GitHub App Token'
63+
id: app-token
64+
uses: actions/create-github-app-token@v3
65+
with:
66+
client-id: ${{ secrets.SAP_CLOUD_SDK_BOT_CLIENT_ID }}
67+
private-key: ${{ secrets.SAP_CLOUD_SDK_BOT_PRIVATE_KEY }}
68+
owner: SAP
69+
repositories: cloud-sdk
70+
permission-contents: write
71+
permission-pull-requests: write
72+
73+
- name: 'Checkout Docs Repository'
6174
uses: actions/checkout@v6
6275
with:
6376
repository: ${{ env.DOCS_REPO }}
6477
path: .cloud-sdk-docs
65-
token: ${{ secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR }}
78+
token: ${{ steps.app-token.outputs.token }}
6679

67-
- name: "Replace JavaDoc"
80+
- name: 'Replace JavaDoc'
6881
id: replace-javadoc
6982
run: |
7083
TARGET_DIR=./.cloud-sdk-docs/static/java-api/v${{ steps.determine-version.outputs.MAJOR_VERSION }}
@@ -95,7 +108,7 @@ jobs:
95108
96109
git push origin $BRANCH_NAME
97110
98-
- name: "Create JavaDoc PR"
111+
- name: 'Create JavaDoc PR'
99112
id: create-javadoc-pr
100113
if: ${{ steps.replace-javadoc.outputs.CREATE_PR == 'true' }}
101114
working-directory: ./.cloud-sdk-docs
@@ -107,4 +120,4 @@ jobs:
107120
echo "PR_URL=$PR_URL" >> $GITHUB_OUTPUT
108121
echo "PR: $PR_URL" >> $GITHUB_STEP_SUMMARY
109122
env:
110-
GH_TOKEN: ${{ secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR }}
123+
GH_TOKEN: ${{ steps.app-token.outputs.token }}

0 commit comments

Comments
 (0)