Skip to content
This repository has been archived by the owner on Nov 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #9 from LizardByte/nightly
Browse files Browse the repository at this point in the history
v0.2.0
  • Loading branch information
ReenigneArcher authored Jan 2, 2023
2 parents dab837e + 092818e commit 14e7939
Show file tree
Hide file tree
Showing 17 changed files with 217 additions and 115 deletions.
45 changes: 0 additions & 45 deletions .github/ISSUE_TEMPLATE/bug-report.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,11 @@ updates:
time: "00:00"
target-branch: "nightly"
open-pull-requests-limit: 10

- package-ecosystem: "gitsubmodule"
directory: "/"
schedule:
interval: "daily"
time: "00:00"
target-branch: "nightly"
open-pull-requests-limit: 10
6 changes: 5 additions & 1 deletion .github/pr_release_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ This PR was created automatically.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Dependency update (updates to dependencies)
- [ ] Documentation update (changes to documentation)
- [ ] Repository update (changes to repository files)
- [ ] Repository update (changes to repository files, e.g. `.github/...`)

## Branch Updates
- [x] I want maintainers to keep my branch updated

## Changelog Summary
<!--- Summarize all the changes in a bulleted list. --->
4 changes: 4 additions & 0 deletions .github/workflows/auto-create-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.

# This workflow creates a PR automatically when anything is merged/pushed into the `nightly` branch. The PR is created
# against the `master` (default) branch.

name: Auto create PR

on:
Expand All @@ -12,6 +15,7 @@ on:

jobs:
create_pr:
if: startsWith(github.repository, 'LizardByte/')
runs-on: ubuntu-latest

steps:
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.

# This workflow will, first, automatically approve PRs created by @LizardByte-bot. Then it will automerge relevant PRs.

name: Automerge PR

on:
Expand All @@ -11,11 +13,16 @@ on:
- opened
- synchronize

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
autoapprove:
if: >
if: >-
contains(fromJson('["LizardByte-bot"]'), github.event.pull_request.user.login) &&
contains(fromJson('["LizardByte-bot"]'), github.actor)
contains(fromJson('["LizardByte-bot"]'), github.actor) &&
startsWith(github.repository, 'LizardByte/')
runs-on: ubuntu-latest
steps:
- name: Autoapproving
Expand All @@ -36,11 +43,9 @@ jobs:
})
automerge:
if: startsWith(github.repository, 'LizardByte/')
needs: [autoapprove]
runs-on: ubuntu-latest
concurrency:
group: automerge-${{ github.ref }}
cancel-in-progress: true

steps:
- name: Automerging
Expand All @@ -49,7 +54,7 @@ jobs:
BASE_BRANCHES: nightly
GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
GITHUB_LOGIN: ${{ secrets.GH_BOT_NAME }}
MERGE_LABELS: ""
MERGE_LABELS: "!dependencies"
MERGE_METHOD: "squash"
MERGE_COMMIT_MESSAGE: "{pullRequest.title} (#{pullRequest.number})"
MERGE_DELETE_BRANCH: true
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/autoupdate-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.

# Label PRs with `autoupdate` if various conditions are met, otherwise, remove the label.

name: Label PR autoupdate

on:
pull_request_target:
types:
- edited
- opened
- reopened
- synchronize

jobs:
label_pr:
if: >-
startsWith(github.repository, 'LizardByte/') &&
contains(github.event.pull_request.body, fromJSON('"] I want maintainers to keep my branch updated"'))
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Check if member
id: org_member
run: |
status="true"
gh api \
-H "Accept: application/vnd.github+json" \
/orgs/${{ github.repository_owner }}/members/${{ github.actor }} || status="false"
echo "result=${status}" >> $GITHUB_OUTPUT
- name: Label autoupdate
if: >-
steps.org_member.outputs.result == 'true' &&
contains(github.event.pull_request.labels.*.name, 'autoupdate') == false &&
contains(github.event.pull_request.body,
fromJSON('"\n- [x] I want maintainers to keep my branch updated"')) == true
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_BOT_TOKEN }}
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['autoupdate']
})
- name: Unlabel autoupdate
if: >-
contains(github.event.pull_request.labels.*.name, 'autoupdate') &&
(
(github.event.action == 'synchronize' && steps.org_member.outputs.result == 'false') ||
(contains(github.event.pull_request.body,
fromJSON('"\n- [x] I want maintainers to keep my branch updated"')) == false
)
)
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_BOT_TOKEN }}
script: |
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: ['autoupdate']
})
26 changes: 20 additions & 6 deletions .github/workflows/autoupdate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.

# This workflow is designed to work with:
# - automerge workflows
# This workflow is designed to work with the following workflows:
# - automerge
# - autoupdate-labeler

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

name: autoupdate

Expand All @@ -17,16 +19,28 @@ on:
- 'nightly'

jobs:
autoupdate-for-bot:
autoupdate:
name: Autoupdate autoapproved PR created in the upstream
if: startsWith(github.repository, 'LizardByte/')
runs-on: ubuntu-latest
steps:
- name: Update
uses: docker://chinthakagodawita/autoupdate-action:v1
env:
EXCLUDED_LABELS: "central_dependency,dependencies"
GITHUB_TOKEN: '${{ secrets.GH_BOT_TOKEN }}'
PR_FILTER: "labelled"
PR_LABELS: "autoupdate"
PR_READY_STATE: "ready_for_review"
MERGE_CONFLICT_ACTION: "ignore"
PR_READY_STATE: "all"
MERGE_CONFLICT_ACTION: "fail"

dependabot-rebase:
name: Dependabot Rebase
if: >-
startsWith(github.repository, 'LizardByte/')
runs-on: ubuntu-latest
steps:
- name: rebase
uses: "bbeesley/[email protected]"
env:
GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
7 changes: 5 additions & 2 deletions .github/workflows/issues-stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.

# Manage stale issues and PRs.

name: Stale Issues / PRs

on:
Expand All @@ -12,10 +14,11 @@ on:
jobs:
stale:
name: Check Stale Issues / PRs
if: startsWith(github.repository, 'LizardByte/')
runs-on: ubuntu-latest
steps:
- name: Stale
uses: actions/stale@v6
uses: actions/stale@v7
with:
close-issue-message: >
This issue was closed because it has been stalled for 10 days with no activity.
Expand All @@ -37,7 +40,7 @@ jobs:
repo-token: ${{ secrets.GH_BOT_TOKEN }}

- name: Invalid Template
uses: actions/stale@v6
uses: actions/stale@v7
with:
close-issue-message: >
This issue was closed because the the template was not completed after 5 days.
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.

# Label and un-label actions using `../label-actions.yml`.

name: Issues

on:
Expand All @@ -14,9 +16,10 @@ on:
jobs:
label:
name: Label Actions
if: startsWith(github.repository, 'LizardByte/')
runs-on: ubuntu-latest
steps:
- name: Label Actions
uses: dessant/label-actions@v2
uses: dessant/label-actions@v3
with:
github-token: ${{ secrets.GH_BOT_TOKEN }}
5 changes: 5 additions & 0 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.

# Ensure PRs are made against `nightly` branch.

name: Pull Requests

on:
pull_request_target:
types: [opened, synchronize, edited, reopened]

# no concurrency for pull_request_target events

jobs:
check-pull-request:
name: Check Pull Request
if: startsWith(github.repository, 'LizardByte/')
runs-on: ubuntu-latest
steps:
- uses: Vankka/pr-target-branch-action@v2
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/python-flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.

# Lint python files with flake8.

name: flake8

on:
pull_request:
branches: [master, nightly]
types: [opened, synchronize, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
flake8:
runs-on: ubuntu-latest
Expand All @@ -24,7 +30,8 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools flake8
# pin flake8 before v6.0.0 due to removal of support for type comments (required for Python 2.7 type hints)
python -m pip install --upgrade pip setuptools "flake8<6"
- name: Test with flake8
run: |
Expand Down
Loading

0 comments on commit 14e7939

Please sign in to comment.