Skip to content

Commit 3532778

Browse files
authored
KCLpy AWS credentials role change and dependabot auto-merge fix (#283)
KCLpy role update and pull request bug fix
1 parent 776af21 commit 3532778

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ version: 2
22
updates:
33
- package-ecosystem: "pip"
44
directory: "/"
5-
open-pull-requests-limit: 2
65
schedule:
7-
interval: "daily"
6+
interval: "weekly"
87

98
- package-ecosystem: "maven"
109
directory: "/"
11-
open-pull-requests-limit: 2
10+
open-pull-requests-limit: 4
1211
schedule:
1312
interval: "daily"

.github/workflows/privileged-run.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@
55

66
name: Sample Run and Dependabot Auto-merge
77
on:
8+
push:
9+
branches: [ master ]
810
pull_request_target:
911
branches: [ master ]
1012
workflow_dispatch:
1113

1214
permissions:
1315
id-token: write
1416
contents: write
17+
pull-requests: write
18+
statuses: write
1519

1620
jobs:
1721
sample-run:
@@ -24,20 +28,22 @@ jobs:
2428
strategy:
2529
fail-fast: false
2630
matrix:
27-
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
31+
python-version: [ "3.9", "3.10", "3.11" ]
2832
jdk-version: [ "8", "11", "17", "21", "24" ]
2933
os: [ ubuntu-latest, macOS-latest, windows-latest ]
3034

3135
steps:
3236
- name: Checkout
3337
uses: actions/checkout@v4
38+
with:
39+
ref: ${{ github.event.pull_request.head.sha }}
3440

3541
- name: Configure AWS Credentials
3642
uses: aws-actions/configure-aws-credentials@v4
3743
with:
3844
aws-region: us-east-1
39-
role-to-assume: arn:aws:iam::751999266872:role/GitHubWorkflows
40-
role-session-name: myGitHubActions
45+
role-to-assume: arn:aws:iam::751999266872:role/GitHubPython
46+
role-session-name: myGitHubActionsPython
4147

4248
- name: Set up JDK ${{ matrix.jdk-version }}
4349
uses: actions/setup-java@v4
@@ -66,6 +72,8 @@ jobs:
6672
python -m build
6773
python setup.py download_jars
6874
python setup.py install
75+
env:
76+
KCL_MVN_REPO_SEARCH_URL: https://repo1.maven.org/maven2/
6977

7078
- name: Put words to sample stream
7179
run: |
@@ -85,17 +93,25 @@ jobs:
8593
auto-merge-dependabot:
8694
needs: [sample-run]
8795
runs-on: ubuntu-latest
88-
if: github.event.pull_request.user.login == 'dependabot[bot]'
96+
if: github.actor == 'dependabot[bot]' && github.event.pull_request.user.login == 'dependabot[bot]'
8997
steps:
9098
- name: Fetch Dependabot metadata
9199
id: metadata
92100
uses: dependabot/fetch-metadata@v2
93101
with:
94102
alert-lookup: true
95103
github-token: "${{ secrets.GITHUB_TOKEN }}"
96-
- name: Enable auto-merge for Dependabot PRs
104+
105+
- name: Approve PR
97106
if: steps.metadata.outputs.update-type != 'version-update:semver-major'
98-
run: gh pr merge --auto --merge "$PR_URL"
107+
run: gh pr review --approve "$PR_URL"
99108
env:
100109
PR_URL: ${{github.event.pull_request.html_url}}
101110
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
111+
112+
# - name: Enable auto-merge for Dependabot PRs
113+
# if: steps.metadata.outputs.update-type != 'version-update:semver-major'
114+
# run: gh pr merge --auto --merge "$PR_URL"
115+
# env:
116+
# PR_URL: ${{github.event.pull_request.html_url}}
117+
# GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,9 @@ def package_url(self, group_id, artifact_id, version):
114114
#
115115
# Sample url:
116116
# https://search.maven.org/remotecontent?filepath=org/apache/httpcomponents/httpclient/4.2/httpclient-4.2.jar
117+
# https://repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/4.2/httpclient-4.2.jar
117118
#
118-
prefix = os.getenv("KCL_MVN_REPO_SEARCH_URL", 'https://search.maven.org/remotecontent?filepath=')
119+
prefix = os.getenv("KCL_MVN_REPO_SEARCH_URL", 'https://repo1.maven.org/maven2/')
119120
return '{prefix}{path}/{artifact_id}/{version}/{dest}'.format(
120121
prefix=prefix,
121122
path='/'.join(group_id.split('.')),

0 commit comments

Comments
 (0)