Skip to content
This repository was archived by the owner on Mar 15, 2024. It is now read-only.

Commit c861719

Browse files
ci: update global workflows (#16)
1 parent 6cf92e7 commit c861719

11 files changed

+287
-44
lines changed

.github/dependabot.yml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,54 @@
1+
---
12
# This action is centrally managed in https://github.com/<organization>/.github/
23
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
34
# the above-mentioned repo.
45

56
version: 2
67
updates:
8+
- package-ecosystem: "docker"
9+
directory: "/"
10+
schedule:
11+
interval: "daily"
12+
time: "08:00"
13+
target-branch: "nightly"
14+
open-pull-requests-limit: 10
15+
716
- package-ecosystem: "github-actions"
817
directory: "/"
918
schedule:
1019
interval: "daily"
11-
time: "00:00"
20+
time: "08:30"
1221
target-branch: "nightly"
1322
open-pull-requests-limit: 10
1423

1524
- package-ecosystem: "npm"
1625
directory: "/"
1726
schedule:
1827
interval: "daily"
19-
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"
2037
target-branch: "nightly"
2138
open-pull-requests-limit: 10
2239

2340
- package-ecosystem: "pip"
2441
directory: "/"
2542
schedule:
2643
interval: "daily"
27-
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"
2853
target-branch: "nightly"
2954
open-pull-requests-limit: 10

.github/label-actions.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
# This action is centrally managed in https://github.com/<organization>/.github/
23
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
34
# the above-mentioned repo.
@@ -24,8 +25,8 @@ invalid:duplicate:
2425
invalid:support:
2526
comment: >
2627
:wave: @{issue-author}, we use the issue tracker exclusively for bug reports.
27-
However, this issue appears to be a support request. Please use
28-
[Discord](https://docs.lizardbyte.dev/about/support.html#discord) for support issues. Thanks.
28+
However, this issue appears to be a support request. Please use our
29+
[Support Center](https://app.lizardbyte.dev/support) for support issues. Thanks.
2930
close: true
3031
lock: true
3132
lock-reason: 'off-topic'

.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: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1+
---
12
# This action is centrally managed in https://github.com/<organization>/.github/
23
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
34
# the above-mentioned repo.
45

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+
59
name: Auto create PR
610

711
on:
8-
pull_request:
9-
types:
10-
- closed
12+
push:
1113
branches:
1214
- 'nightly'
1315

1416
jobs:
1517
create_pr:
16-
if: github.event.pull_request.merged == true
18+
if: startsWith(github.repository, 'LizardByte/')
1719
runs-on: ubuntu-latest
1820

1921
steps:
@@ -25,7 +27,7 @@ jobs:
2527
with:
2628
source_branch: "" # should be "nightly" as it's the triggering branch
2729
destination_branch: "master"
28-
pr_title: "Pulling ${{ github.ref }} into master"
30+
pr_title: "Pulling ${{ github.ref_name }} into master"
2931
pr_template: ".github/pr_release_template.md"
3032
pr_assignee: "${{ secrets.GH_BOT_NAME }}"
3133
pr_draft: true

.github/workflows/automerge.yml

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
---
12
# This action is centrally managed in https://github.com/<organization>/.github/
23
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
34
# the above-mentioned repo.
45

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

710
on:
@@ -10,45 +13,48 @@ on:
1013
- opened
1114
- synchronize
1215

16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
1320
jobs:
1421
autoapprove:
15-
if: >
22+
if: >-
1623
contains(fromJson('["LizardByte-bot"]'), github.event.pull_request.user.login) &&
17-
contains(fromJson('["LizardByte-bot"]'), github.actor)
24+
contains(fromJson('["LizardByte-bot"]'), github.actor) &&
25+
startsWith(github.repository, 'LizardByte/')
1826
runs-on: ubuntu-latest
1927
steps:
20-
- name: Autoapproving
21-
uses: hmarr/auto-approve-action@v2
22-
with:
23-
github-token: "${{ secrets.GITHUB_TOKEN }}"
24-
25-
- name: Label autoapproved
26-
uses: actions/github-script@v5
27-
with:
28-
github-token: ${{ secrets.GH_BOT_TOKEN }}
29-
script: |
30-
github.rest.issues.addLabels({
31-
issue_number: context.issue.number,
32-
owner: context.repo.owner,
33-
repo: context.repo.repo,
34-
labels: ['autoapproved', 'autoupdate']
35-
})
28+
- name: Autoapproving
29+
uses: hmarr/auto-approve-action@v3
30+
with:
31+
github-token: "${{ secrets.GITHUB_TOKEN }}"
32+
33+
- name: Label autoapproved
34+
uses: actions/github-script@v6
35+
with:
36+
github-token: ${{ secrets.GH_BOT_TOKEN }}
37+
script: |
38+
github.rest.issues.addLabels({
39+
issue_number: context.issue.number,
40+
owner: context.repo.owner,
41+
repo: context.repo.repo,
42+
labels: ['autoapproved', 'autoupdate']
43+
})
3644
3745
automerge:
46+
if: startsWith(github.repository, 'LizardByte/')
3847
needs: [autoapprove]
3948
runs-on: ubuntu-latest
40-
concurrency:
41-
group: automerge-${{ github.ref }}
42-
cancel-in-progress: true
4349

4450
steps:
4551
- name: Automerging
46-
uses: pascalgn/[email protected].3
52+
uses: pascalgn/[email protected].5
4753
env:
4854
BASE_BRANCHES: nightly
4955
GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
5056
GITHUB_LOGIN: ${{ secrets.GH_BOT_NAME }}
51-
MERGE_LABELS: ""
57+
MERGE_LABELS: "!dependencies"
5258
MERGE_METHOD: "squash"
5359
MERGE_COMMIT_MESSAGE: "{pullRequest.title} (#{pullRequest.number})"
5460
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: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
# This workflow is designed to work with the following workflows:
7+
# - automerge
8+
# - autoupdate-labeler
9+
10+
# It uses an action that auto-updates pull requests branches, when changes are pushed to their destination branch.
11+
# 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)
13+
14+
name: autoupdate
15+
16+
on:
17+
push:
18+
branches:
19+
- 'nightly'
20+
21+
jobs:
22+
autoupdate:
23+
name: Autoupdate autoapproved PR created in the upstream
24+
if: startsWith(github.repository, 'LizardByte/')
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Update
28+
uses: docker://chinthakagodawita/autoupdate-action:v1
29+
env:
30+
EXCLUDED_LABELS: "central_dependency,dependencies"
31+
GITHUB_TOKEN: '${{ secrets.GH_BOT_TOKEN }}'
32+
PR_FILTER: "labelled"
33+
PR_LABELS: "autoupdate"
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 }}

.github/workflows/issues-stale.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
1+
---
12
# This action is centrally managed in https://github.com/<organization>/.github/
23
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
34
# the above-mentioned repo.
45

6+
# Manage stale issues and PRs.
7+
58
name: Stale Issues / PRs
69

710
on:
811
schedule:
9-
- cron: '00 00 * * *'
12+
- cron: '00 10 * * *'
1013

1114
jobs:
1215
stale:
1316
name: Check Stale Issues / PRs
17+
if: startsWith(github.repository, 'LizardByte/')
1418
runs-on: ubuntu-latest
1519
steps:
1620
- name: Stale
17-
uses: actions/stale@v5
21+
uses: actions/stale@v7
1822
with:
1923
close-issue-message: >
20-
This issue was closed because it has been stalled for 5 days with no activity.
24+
This issue was closed because it has been stalled for 10 days with no activity.
2125
close-pr-message: >
2226
This PR was closed because it has been stalled for 10 days with no activity.
2327
days-before-stale: 90
@@ -27,15 +31,16 @@ jobs:
2731
exempt-pr-labels: 'dependencies,l10n'
2832
stale-issue-label: 'stale'
2933
stale-issue-message: >
30-
This issue is stale because it has been open for 30 days with no activity.
31-
Comment or remove the stale label, otherwise this will be closed in 5 days.
34+
This issue is stale because it has been open for 90 days with no activity.
35+
Comment or remove the stale label, otherwise this will be closed in 10 days.
3236
stale-pr-label: 'stale'
3337
stale-pr-message: >
3438
This PR is stale because it has been open for 90 days with no activity.
3539
Comment or remove the stale label, otherwise this will be closed in 10 days.
40+
repo-token: ${{ secrets.GH_BOT_TOKEN }}
3641

3742
- name: Invalid Template
38-
uses: actions/stale@v5
43+
uses: actions/stale@v7
3944
with:
4045
close-issue-message: >
4146
This issue was closed because the the template was not completed after 5 days.
@@ -51,3 +56,4 @@ jobs:
5156
stale-pr-label: 'invalid:template-incomplete'
5257
stale-pr-message: >
5358
Invalid PR template.
59+
repo-token: ${{ secrets.GH_BOT_TOKEN }}

0 commit comments

Comments
 (0)