-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into muharem-remove-fellow…
…ship-import-migration
- Loading branch information
Showing
40 changed files
with
1,707 additions
and
1,234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/usr/bin/env python | ||
|
||
import os | ||
import sys | ||
import argparse | ||
|
||
parser = argparse.ArgumentParser(description="Process the CHANGELOG.md") | ||
parser.add_argument( | ||
"changelog", | ||
metavar="CHANGELOG", | ||
help="Path to the CHANGELOG.md file", | ||
default="CHANGELOG.md", | ||
nargs='?' | ||
) | ||
|
||
group = parser.add_mutually_exclusive_group() | ||
group.add_argument( | ||
"--print-latest-version", | ||
dest="print_latest_version", | ||
help="Print the latest version (first in the file) found in the CHANGELOG.md", | ||
action="store_true" | ||
) | ||
group.add_argument( | ||
"--should-release", | ||
dest="should_release", | ||
help="Should a release be made? Prints `1` or `0`.", | ||
action="store_true" | ||
) | ||
|
||
args = parser.parse_args() | ||
|
||
with open(args.changelog, "r") as changelog: | ||
lines = changelog.readlines() | ||
|
||
# Find the latest version | ||
for line in lines: | ||
if not line.startswith("## ["): | ||
continue | ||
|
||
version = line.strip().removeprefix("## [").split("]")[0] | ||
break | ||
|
||
if args.print_latest_version: | ||
print(version, end = "") | ||
sys.exit(0) | ||
elif args.should_release: | ||
if version.lower() == "unreleased": | ||
print("0", end = "") | ||
sys.exit(-1) | ||
elif version.count(".") != 2: | ||
print("0", end = "") | ||
sys.exit(-1) | ||
|
||
stream = os.popen("git tag -l v" + version) | ||
output = stream.read() | ||
|
||
# Empty output means that the tag doesn't exist and that we should release. | ||
if output.strip() == "": | ||
print("1", end = "") | ||
else: | ||
print("0", end = "") | ||
|
||
sys.exit(0) | ||
else: | ||
parser.print_help() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!-- Remember that you can run `/merge` to enable auto-merge in the PR --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Auto Merge Bot | ||
|
||
on: | ||
# GitHub considers PRs as issues | ||
issue_comment: | ||
types: [created] | ||
|
||
jobs: | ||
set-auto-merge: | ||
runs-on: ubuntu-latest | ||
environment: master | ||
# Important! This forces the job to run only on comments on Pull Requests that starts with '/merge' | ||
if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/merge') }} | ||
steps: | ||
- name: Get the GitHub handle of the fellows | ||
uses: paritytech/[email protected] | ||
id: fellows | ||
- name: Generate token | ||
id: merge_token | ||
uses: tibdex/github-app-token@v1 | ||
with: | ||
app_id: ${{ secrets.MERGE_APP_ID }} | ||
private_key: ${{ secrets.MERGE_APP_KEY }} | ||
- name: Set auto merge | ||
uses: paritytech/[email protected] | ||
with: | ||
GITHUB_TOKEN: ${{ steps.merge_token.outputs.token }} | ||
MERGE_METHOD: "SQUASH" | ||
ALLOWLIST: ${{ steps.fellows.outputs.github-handles }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,34 @@ | ||
name: Review PR | ||
name: Review Bot | ||
|
||
on: | ||
pull_request_target: | ||
workflow_run: | ||
workflows: | ||
- Review-Trigger | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- review_requested | ||
- review_request_removed | ||
- ready_for_review | ||
pull_request_review: | ||
- completed | ||
|
||
permissions: | ||
contents: read | ||
checks: write | ||
|
||
jobs: | ||
review-approvals: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Extract content of artifact | ||
id: number | ||
uses: Bullrich/[email protected] | ||
with: | ||
artifact-name: pr_number | ||
- name: Generate token | ||
id: team_token | ||
uses: tibdex/github-app-token@v1 | ||
with: | ||
app_id: ${{ secrets.REVIEW_APP_ID }} | ||
private_key: ${{ secrets.REVIEW_APP_KEY }} | ||
- name: "Evaluates PR reviews and assigns reviewers" | ||
uses: paritytech/review-bot@v2.0.0 | ||
uses: paritytech/review-bot@v2.1.0 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
team-token: ${{ steps.team_token.outputs.token }} | ||
checks-token: ${{ steps.team_token.outputs.token }} | ||
pr-number: ${{ steps.number.outputs.content }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Review-Trigger | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- review_requested | ||
- review_request_removed | ||
- ready_for_review | ||
pull_request_review: | ||
|
||
jobs: | ||
trigger-review-bot: | ||
runs-on: ubuntu-latest | ||
name: trigger review bot | ||
steps: | ||
- name: Get PR number | ||
env: | ||
PR_NUMBER: ${{ github.event.pull_request.number }} | ||
run: | | ||
echo "Saving PR number: $PR_NUMBER" | ||
mkdir -p ./pr | ||
echo $PR_NUMBER > ./pr/pr_number | ||
- uses: actions/upload-artifact@v3 | ||
name: Save PR number | ||
with: | ||
name: pr_number | ||
path: pr/ | ||
retention-days: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.