Skip to content

Commit 776af21

Browse files
authored
Add dependabot auto-merge and workflow dispatch; update documentation (#280)
add dependabot auto-merge and workflow dispatch; update documentation
1 parent 61ee326 commit 776af21

File tree

2 files changed

+37
-10
lines changed

2 files changed

+37
-10
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,12 @@ version: 2
22
updates:
33
- package-ecosystem: "pip"
44
directory: "/"
5+
open-pull-requests-limit: 2
56
schedule:
6-
interval: "weekly"
7+
interval: "daily"
8+
9+
- package-ecosystem: "maven"
10+
directory: "/"
11+
open-pull-requests-limit: 2
12+
schedule:
13+
interval: "daily"

.github/workflows/privileged-run.yml

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
1+
# This workflow will trigger on pushes, pull requests (to master branch), and manually from the GitHub Actions tab (when requested)
2+
# sample_run uses matrix to create 12 unique combinations of operating systems and python versions
3+
# each of the 12 runs download the jars needed to run the KCL, run the sample_kinesis_wordputter.py, and use a timeout command to run the sample_kclpy_app.py
4+
# auto_merge uses GitHub events to check if dependabot is the pull requester, and if the request fits the criteria the PR is automatically merged
35

4-
name: Build Intensive
6+
name: Sample Run and Dependabot Auto-merge
57
on:
6-
push:
7-
branches: [ master ]
88
pull_request_target:
99
branches: [ master ]
10+
workflow_dispatch:
1011

1112
permissions:
1213
id-token: write
13-
contents: read
14+
contents: write
1415

1516
jobs:
16-
build-intensive:
17+
sample-run:
1718
timeout-minutes: 8
1819
runs-on: ${{ matrix.os }}
1920
defaults:
@@ -24,6 +25,7 @@ jobs:
2425
fail-fast: false
2526
matrix:
2627
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
28+
jdk-version: [ "8", "11", "17", "21", "24" ]
2729
os: [ ubuntu-latest, macOS-latest, windows-latest ]
2830

2931
steps:
@@ -37,10 +39,10 @@ jobs:
3739
role-to-assume: arn:aws:iam::751999266872:role/GitHubWorkflows
3840
role-session-name: myGitHubActions
3941

40-
- name: Set up JDK 8
42+
- name: Set up JDK ${{ matrix.jdk-version }}
4143
uses: actions/setup-java@v4
4244
with:
43-
java-version: '8'
45+
java-version: ${{ matrix.jdk-version }}
4446
distribution: 'corretto'
4547

4648
- name: Set up Python ${{ matrix.python-version }}
@@ -79,3 +81,21 @@ jobs:
7981
run: |
8082
brew install coreutils
8183
gtimeout 45 $(amazon_kclpy_helper.py --print_command --java $(which java) --properties samples/sample.properties) || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi
84+
85+
auto-merge-dependabot:
86+
needs: [sample-run]
87+
runs-on: ubuntu-latest
88+
if: github.event.pull_request.user.login == 'dependabot[bot]'
89+
steps:
90+
- name: Fetch Dependabot metadata
91+
id: metadata
92+
uses: dependabot/fetch-metadata@v2
93+
with:
94+
alert-lookup: true
95+
github-token: "${{ secrets.GITHUB_TOKEN }}"
96+
- name: Enable auto-merge for Dependabot PRs
97+
if: steps.metadata.outputs.update-type != 'version-update:semver-major'
98+
run: gh pr merge --auto --merge "$PR_URL"
99+
env:
100+
PR_URL: ${{github.event.pull_request.html_url}}
101+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)