Skip to content

Commit c7d5c35

Browse files
Merge pull request #121 from LizardByte/nightly
v0.1.2
2 parents 0941b25 + a221f5e commit c7d5c35

17 files changed

+474
-115
lines changed

.flake8

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[flake8]
22
filename =
3-
*.py
3+
*.py,
4+
*.pys
45
max-line-length = 120
56
extend-exclude =
67
venv/

.github/dependabot.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,46 @@ updates:
99
directory: "/"
1010
schedule:
1111
interval: "daily"
12-
time: "00:00"
12+
time: "08:00"
1313
target-branch: "nightly"
1414
open-pull-requests-limit: 10
1515

1616
- package-ecosystem: "github-actions"
1717
directory: "/"
1818
schedule:
1919
interval: "daily"
20-
time: "00:00"
20+
time: "08:30"
2121
target-branch: "nightly"
2222
open-pull-requests-limit: 10
2323

2424
- package-ecosystem: "npm"
2525
directory: "/"
2626
schedule:
2727
interval: "daily"
28-
time: "00:00"
28+
time: "09:00"
29+
target-branch: "nightly"
30+
open-pull-requests-limit: 10
31+
32+
- package-ecosystem: "nuget"
33+
directory: "/"
34+
schedule:
35+
interval: "daily"
36+
time: "09:30"
2937
target-branch: "nightly"
3038
open-pull-requests-limit: 10
3139

3240
- package-ecosystem: "pip"
3341
directory: "/"
3442
schedule:
3543
interval: "daily"
36-
time: "00:00"
44+
time: "10:00"
45+
target-branch: "nightly"
46+
open-pull-requests-limit: 10
47+
48+
- package-ecosystem: "gitsubmodule"
49+
directory: "/"
50+
schedule:
51+
interval: "daily"
52+
time: "10:30"
3753
target-branch: "nightly"
3854
open-pull-requests-limit: 10

.github/pr_release_template.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ This PR was created automatically.
1717
- [ ] Bug fix (non-breaking change which fixes an issue)
1818
- [ ] New feature (non-breaking change which adds functionality)
1919
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
20+
- [ ] Dependency update (updates to dependencies)
2021
- [ ] Documentation update (changes to documentation)
21-
- [ ] Repository update (changes to repository files)
22+
- [ ] Repository update (changes to repository files, e.g. `.github/...`)
23+
24+
## Branch Updates
25+
- [x] I want maintainers to keep my branch updated
2226

2327
## Changelog Summary
2428
<!--- Summarize all the changes in a bulleted list. --->

.github/workflows/auto-create-pr.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
44
# the above-mentioned repo.
55

6+
# This workflow creates a PR automatically when anything is merged/pushed into the `nightly` branch. The PR is created
7+
# against the `master` (default) branch.
8+
69
name: Auto create PR
710

811
on:
@@ -12,6 +15,7 @@ on:
1215

1316
jobs:
1417
create_pr:
18+
if: startsWith(github.repository, 'LizardByte/')
1519
runs-on: ubuntu-latest
1620

1721
steps:

.github/workflows/automerge.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
44
# the above-mentioned repo.
55

6+
# This workflow will, first, automatically approve PRs created by @LizardByte-bot. Then it will automerge relevant PRs.
7+
68
name: Automerge PR
79

810
on:
@@ -11,15 +13,20 @@ on:
1113
- opened
1214
- synchronize
1315

16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
1420
jobs:
1521
autoapprove:
16-
if: >
22+
if: >-
1723
contains(fromJson('["LizardByte-bot"]'), github.event.pull_request.user.login) &&
18-
contains(fromJson('["LizardByte-bot"]'), github.actor)
24+
contains(fromJson('["LizardByte-bot"]'), github.actor) &&
25+
startsWith(github.repository, 'LizardByte/')
1926
runs-on: ubuntu-latest
2027
steps:
2128
- name: Autoapproving
22-
uses: hmarr/auto-approve-action@v2
29+
uses: hmarr/auto-approve-action@v3
2330
with:
2431
github-token: "${{ secrets.GITHUB_TOKEN }}"
2532

@@ -36,20 +43,18 @@ jobs:
3643
})
3744
3845
automerge:
46+
if: startsWith(github.repository, 'LizardByte/')
3947
needs: [autoapprove]
4048
runs-on: ubuntu-latest
41-
concurrency:
42-
group: automerge-${{ github.ref }}
43-
cancel-in-progress: true
4449

4550
steps:
4651
- name: Automerging
47-
uses: pascalgn/[email protected].3
52+
uses: pascalgn/[email protected].5
4853
env:
4954
BASE_BRANCHES: nightly
5055
GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
5156
GITHUB_LOGIN: ${{ secrets.GH_BOT_NAME }}
52-
MERGE_LABELS: ""
57+
MERGE_LABELS: "!dependencies"
5358
MERGE_METHOD: "squash"
5459
MERGE_COMMIT_MESSAGE: "{pullRequest.title} (#{pullRequest.number})"
5560
MERGE_DELETE_BRANCH: true
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
# This action is centrally managed in https://github.com/<organization>/.github/
3+
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
4+
# the above-mentioned repo.
5+
6+
# Label PRs with `autoupdate` if various conditions are met, otherwise, remove the label.
7+
8+
name: Label PR autoupdate
9+
10+
on:
11+
pull_request_target:
12+
types:
13+
- edited
14+
- opened
15+
- reopened
16+
- synchronize
17+
18+
jobs:
19+
label_pr:
20+
if: >-
21+
startsWith(github.repository, 'LizardByte/') &&
22+
contains(github.event.pull_request.body, fromJSON('"] I want maintainers to keep my branch updated"'))
23+
runs-on: ubuntu-latest
24+
env:
25+
GH_TOKEN: ${{ github.token }}
26+
steps:
27+
- name: Check if member
28+
id: org_member
29+
run: |
30+
status="true"
31+
gh api \
32+
-H "Accept: application/vnd.github+json" \
33+
/orgs/${{ github.repository_owner }}/members/${{ github.actor }} || status="false"
34+
35+
echo "result=${status}" >> $GITHUB_OUTPUT
36+
37+
- name: Label autoupdate
38+
if: >-
39+
steps.org_member.outputs.result == 'true' &&
40+
contains(github.event.pull_request.labels.*.name, 'autoupdate') == false &&
41+
contains(github.event.pull_request.body,
42+
fromJSON('"\n- [x] I want maintainers to keep my branch updated"')) == true
43+
uses: actions/github-script@v6
44+
with:
45+
github-token: ${{ secrets.GH_BOT_TOKEN }}
46+
script: |
47+
github.rest.issues.addLabels({
48+
issue_number: context.issue.number,
49+
owner: context.repo.owner,
50+
repo: context.repo.repo,
51+
labels: ['autoupdate']
52+
})
53+
54+
- name: Unlabel autoupdate
55+
if: >-
56+
contains(github.event.pull_request.labels.*.name, 'autoupdate') &&
57+
(
58+
(github.event.action == 'synchronize' && steps.org_member.outputs.result == 'false') ||
59+
(contains(github.event.pull_request.body,
60+
fromJSON('"\n- [x] I want maintainers to keep my branch updated"')) == false
61+
)
62+
)
63+
uses: actions/github-script@v6
64+
with:
65+
github-token: ${{ secrets.GH_BOT_TOKEN }}
66+
script: |
67+
github.rest.issues.removeLabel({
68+
issue_number: context.issue.number,
69+
owner: context.repo.owner,
70+
repo: context.repo.repo,
71+
name: ['autoupdate']
72+
})

.github/workflows/autoupdate.yml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
44
# the above-mentioned repo.
55

6-
# This workflow is designed to work with:
7-
# - automerge workflows
6+
# This workflow is designed to work with the following workflows:
7+
# - automerge
8+
# - autoupdate-labeler
89

9-
# It uses GitHub Action that auto-updates pull requests branches, when changes are pushed to their destination branch.
10+
# It uses an action that auto-updates pull requests branches, when changes are pushed to their destination branch.
1011
# Auto-updating to the latest destination branch works only in the context of upstream repo and not forks.
12+
# Dependabot PRs are updated by an action that comments `@depdenabot rebase` on dependabot PRs. (disabled)
1113

1214
name: autoupdate
1315

@@ -17,16 +19,33 @@ on:
1719
- 'nightly'
1820

1921
jobs:
20-
autoupdate-for-bot:
22+
autoupdate:
2123
name: Autoupdate autoapproved PR created in the upstream
2224
if: startsWith(github.repository, 'LizardByte/')
2325
runs-on: ubuntu-latest
2426
steps:
2527
- name: Update
2628
uses: docker://chinthakagodawita/autoupdate-action:v1
2729
env:
30+
EXCLUDED_LABELS: "central_dependency,dependencies"
2831
GITHUB_TOKEN: '${{ secrets.GH_BOT_TOKEN }}'
2932
PR_FILTER: "labelled"
3033
PR_LABELS: "autoupdate"
31-
PR_READY_STATE: "ready_for_review"
32-
MERGE_CONFLICT_ACTION: "ignore"
34+
PR_READY_STATE: "all"
35+
MERGE_CONFLICT_ACTION: "fail"
36+
37+
# Disabled due to:
38+
# - no major version tag, resulting in constant nagging to update this action
39+
# - additionally, the code is sketchy, 16k+ lines of code?
40+
# https://github.com/bbeesley/gha-auto-dependabot-rebase/blob/main/dist/main.cjs
41+
#
42+
# dependabot-rebase:
43+
# name: Dependabot Rebase
44+
# if: >-
45+
# startsWith(github.repository, 'LizardByte/')
46+
# runs-on: ubuntu-latest
47+
# steps:
48+
# - name: rebase
49+
# uses: "bbeesley/[email protected]"
50+
# env:
51+
# GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }}

0 commit comments

Comments
 (0)