Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dnm] test1 #17

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
cd3f985
skip trigger for review bot on draft PRs
Bullrich Nov 3, 2023
be17c46
Merge branch 'paritytech:master' into master
mordamax Nov 8, 2023
e255942
[DNM] (#6)
mordamax Nov 12, 2023
1b08dc2
modify command-bot
mordamax Nov 13, 2023
1e9312c
modify command-bot 2
mordamax Nov 13, 2023
afe4d37
modify command-bot 3
mordamax Nov 13, 2023
e01dfea
modify command-bot 4
mordamax Nov 13, 2023
98e49aa
modify command-bot 5
mordamax Nov 13, 2023
1cc122e
modify command-bot 6
mordamax Nov 13, 2023
8da7d10
added auto merge
Bullrich Nov 16, 2023
13c875d
Merge branch 'paritytech:master' into master
alvicsam Nov 16, 2023
81eb73d
added trigger for merge_queues
Bullrich Nov 17, 2023
633f0fb
added commit sha
Bullrich Nov 17, 2023
204b86c
changed the action
Bullrich Nov 20, 2023
34acbfa
corrected wrong token for review-trigger action
Bullrich Nov 20, 2023
2c530fe
added action to pass merge queues
Bullrich Nov 20, 2023
28d8d02
removed wrong if condition in action
Bullrich Nov 20, 2023
ca8ab0f
change context of action
Bullrich Nov 20, 2023
3881c32
moved queue action to use master env
Bullrich Nov 20, 2023
c944eb0
fixed lack of environment
Bullrich Nov 20, 2023
986b754
Merge branch 'paritytech:master' into master
alvicsam Nov 24, 2023
d5a08aa
Merge branch 'paritytech:master' into master
alvicsam Nov 27, 2023
3c9eebd
[ci] test mq vol.3 (#10)
alvicsam Nov 27, 2023
236915d
Merge remote-tracking branch 'origin/master'
Dec 12, 2023
b7dad1f
Merge remote-tracking branch 'origin/master'
Jan 12, 2024
61813a5
Merge branch 'paritytech:master' into master
mordamax Feb 8, 2024
28f7ba3
Update BRIDGES.md
mordamax Feb 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Auto Merge Bot

on:
# GitHub considers PRs as issues
issue_comment:
types: [created]

jobs:
set-auto-merge:
runs-on: ubuntu-latest
# 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/get-fellows-action@v1.0.0
id: fellows
- name: Generate token
id: merge_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.REVIEW_APP_ID }}
private_key: ${{ secrets.REVIEW_APP_KEY }}
- name: Set auto merge
uses: paritytech/auto-merge-bot@v1.0.0
with:
GITHUB_TOKEN: ${{ steps.merge_token.outputs.token }}
MERGE_METHOD: "SQUASH"
ALLOWLIST: ${{ steps.fellows.outputs.github-handles }}
68 changes: 68 additions & 0 deletions .github/workflows/command-bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Command Bot

on:
workflow_dispatch:
inputs:
use_self_hosted:
description: 'Use self-hosted runner'
required: true
default: 'false'
image_name:
description: 'Docker image to use'
required: true
script_path:
description: 'Path to the command bot script to run'
required: true
scripts_branch:
description: 'Branch to checkout scripts from'
default: 'main'
variablesJson:
description: 'Variables to pass to the script'
required: true
default: '{}'

env:
PIPELINE_SCRIPTS_DIR: ${{ github.workspace }}/command-bot-scripts
PIPELINE_SCRIPTS_REF: ${{ github.event.inputs.scripts_branch }}
ARTIFACTS_DIR: ${{ github.workspace }}/.git/.artifacts

jobs:
command_bot_job:
runs-on: ${{ (github.event.inputs.use_self_hosted == 'true' && 'parity-gha-runner') || 'ubuntu-latest' }}
container:
image: ${{ github.event.inputs.image_name }}

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout scripts
uses: actions/checkout@v3
with:
repository: paritytech/command-bot-scripts
ref: ${{ env.PIPELINE_SCRIPTS_REF }}
path: ${{ env.PIPELINE_SCRIPTS_DIR }}

# Rest of your steps
- name: Run Script
env:
RUNNER_LABELS: ${{ runner.labels }}
IMAGE_NAME: ${{ github.event.inputs.image_name }}
SCRIPTS_PATH: ${{ github.event.inputs.script_path }}
shell: bash
run: |
VARIABLES_JSON="${{ github.event.inputs.variablesJson }}"
echo "$VARIABLES_JSON" > .git/variables.json

echo "${{ github.event.inputs.variablesJson }}" | base64 -d > .git/variables.json
while IFS="=" read -r key value; do
echo "$key=$value" >> $GITHUB_ENV
done < <(jq -r "to_entries|map(\"\(.key)=\(.value|tostring)\")|.[]" .git/variables.json)

echo "Running on ${RUNNER_LABELS}"
echo "Using image ${IMAGE_NAME}"
echo "Scripts path: ${{ env.SCRIPTS_PATH }}"
bash ${{ github.event.inputs.script_path }}

28 changes: 28 additions & 0 deletions .github/workflows/merge-queue-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Merge-Queue

on:
merge_group:

jobs:
trigger-review-bot:
runs-on: ubuntu-latest
environment: master
name: trigger review bot
steps:
- name: Generate token
id: app_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.REVIEW_APP_ID }}
private_key: ${{ secrets.REVIEW_APP_KEY }}
- run: echo "Running with commit $ID"
env:
ID: ${{ github.event.merge_group.head_commit.id }}
- name: Add Merge Queue status check
uses: billyjbryant/create-status-check@v2
with:
authToken: ${{ steps.app_token.outputs.token }}
context: 'review-bot'
description: 'PRs for merge queue gets approved'
state: 'success'
sha: ${{ github.event.merge_group.head_commit.id }}
24 changes: 21 additions & 3 deletions .github/workflows/review-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,37 @@ jobs:
runs-on: ubuntu-latest
name: trigger review bot
steps:
- name: Skip merge queue
if: ${{ contains(github.ref, 'gh-readonly-queue') }}
run: exit 0
- name: Get PR number
if: ${{ github.event_name != 'merge_group' }}
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
if: ${{ github.event_name != 'merge_group' }}
name: Save PR number
with:
name: pr_number
path: pr/
retention-days: 5
- name: Generate token
if: ${{ github.event_name == 'merge_group' }}
id: app_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.REVIEW_APP_ID }}
private_key: ${{ secrets.REVIEW_APP_KEY }}
- run: echo "Running with commit $ID"
env:
ID: ${{ github.event.merge_group.head_commit.id }}
- name: Add Merge Queue status check
if: ${{ github.event_name == 'merge_group' }}
uses: billyjbryant/create-status-check@v2
with:
authToken: ${{ steps.app_token.outputs.token }}
context: 'Approved Merge Queue'
description: 'PRs for merge queue gets approved'
state: 'success'
sha: ${{ github.event.merge_group.head_commit.id || github.sha}}
2 changes: 1 addition & 1 deletion BRIDGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Using Parity Bridges Common dependency (`git subtree`)
# Using Parity Bridges Common dependency (`git subtree`)1

In `./bridges` sub-directory you can find a `git subtree` imported version of:
[`parity-bridges-common`](https://github.com/paritytech/parity-bridges-common/) repository.
Expand Down
Loading