-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
nareshmmr
committed
Nov 26, 2024
0 parents
commit 1901e09
Showing
803 changed files
with
166,574 additions
and
0 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 @@ | ||
use flake . |
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,18 @@ | ||
#!/bin/bash | ||
|
||
# Define the regex pattern for Ethereum keys | ||
ethereum_key_pattern="(0x[a-fA-F0-9]{40})" | ||
|
||
# Loop over each file passed to the script | ||
for file in "$@"; do | ||
echo -n "Checking $file for ethereum keys... " | ||
|
||
if grep -q "$ethereum_key_pattern" "$file"; then | ||
echo -e "❌\nFound eth keys in $file:" | ||
grep -n "$ethereum_key_pattern" "$file" | ||
echo -e "\e[31mRemove the Ethereum key before committing.\e[0m\n" | ||
exit 1 | ||
else | ||
echo "✅" | ||
fi | ||
done |
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,17 @@ | ||
#!/bin/bash | ||
|
||
# Define the regex pattern for HTTP and WS URLs | ||
url_pattern="(http|ws)(s)?:\/\/[^ \t\n\r]+" | ||
|
||
# Loop over each file passed to the script | ||
for file in "$@"; do | ||
echo -n "Checking $file for RPC URLs... " | ||
if grep -q "$url_pattern" "$file"; then | ||
echo -e "❌\nFound RPC URL in $file:" | ||
grep -n "$url_pattern" "$file" | ||
echo -e "\e[31mRemove the RPC URL before committing.\e[0m\n" | ||
exit 1 | ||
else | ||
echo "✅" | ||
fi | ||
done |
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,23 @@ | ||
#!/bin/bash | ||
|
||
# Find all 'go.mod' files, get their directories, and run 'go mod tidy' | ||
find "./" -type f -name 'go.mod' -print0 | while IFS= read -r -d $'\0' file; do | ||
directory=$(dirname "$file") | ||
cd "$directory" || exit 1 | ||
|
||
# Run linter and capture exit status | ||
set +e | ||
golangci-lint run -v | ||
linting_result=$? | ||
set -e | ||
|
||
# Check linting result | ||
if [[ $linting_result -ne 0 ]]; then | ||
echo -e "Executing linters in $directory... \e[31mNOK!\e[0m\n" | ||
echo -e "Run \`cd $directory && golangci-lint run --fix -v\` and fix the issues\n" | ||
exit 1 | ||
else | ||
echo -e "Executing linters in $directory... \e[32mOK!\e[0m\n" | ||
fi | ||
cd - || exit 1 | ||
done |
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,14 @@ | ||
#!/bin/bash | ||
|
||
# Loop over each file passed to the script | ||
for file in "$@"; do | ||
echo -n "Checking $file for local replacements... " | ||
if grep -q 'replace .* => /' "$file"; then | ||
echo -e "❌\nFound local replacements in $file:" | ||
grep -n 'replace .* => /' "$file" | ||
echo -e "\e[31mYou forgot about a local replacement\e[0m\n" | ||
exit 1 | ||
else | ||
echo "✅" | ||
fi | ||
done |
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,23 @@ | ||
#!/bin/bash | ||
|
||
set +e | ||
|
||
# Find all 'go.mod' files, get their directories, and run 'go mod tidy' | ||
find "./" -type f -name 'go.mod' -print0 | while IFS= read -r -d $'\0' file; do | ||
dir=$(dirname "$file") | ||
echo "Executing cd \"$dir\" && go mod tidy" | ||
cd "$dir" || exit 1 | ||
go mod tidy | ||
cd - || exit 1 | ||
done | ||
# pre-commit stashes changes before running the hooks so we can use git to check for changes here | ||
# Run git diff and capture output | ||
output=$(git diff --stat) | ||
|
||
if [ -z "$output" ]; then | ||
echo "No changes in any files." | ||
else | ||
echo "go.mod files that need to be tidied:" | ||
echo "$output" | awk -F '|' '/\|/ { print $1 }' | ||
exit 1 | ||
fi |
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,12 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Find all 'go.mod' files, get their directories, and run an empty 'go test' in them to compile the tests. | ||
find "./" -type f -name 'go.mod' -print0 | while IFS= read -r -d $'\0' file; do | ||
dir=$(dirname "$file") | ||
echo "Executing cd \"$dir\" && go test -run=^# ./..." | ||
cd "$dir" | ||
go test -run=^# ./... | ||
cd - | ||
done |
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,5 @@ | ||
#!/bin/bash | ||
|
||
printf "Executing unit tests..." | ||
|
||
make test_unit |
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,15 @@ | ||
#!/bin/bash | ||
|
||
set +e | ||
# shellcheck disable=SC2068 | ||
typos --config ./_typos.toml --force-exclude $@ | ||
typos_result=$? | ||
set -e | ||
|
||
# Check typos result | ||
if [[ $typos_result -ne 0 ]]; then | ||
echo -e "❌ Found typos\n" | ||
# shellcheck disable=SC2145 | ||
echo -e "Run \`typos --write-changes --config ./_typos.toml --force-exclude $@\` and fix any issues left\n" | ||
exit 1 | ||
fi |
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,33 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**Versions** | ||
|
||
- OS: | ||
- Integrations Framework Version: | ||
- plugin-testing-framework Version: | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
|
||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Code** | ||
If applicable, add the code of the test you're running. | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
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,19 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
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,56 @@ | ||
name: 'Update Internal Mirrors Action' | ||
inputs: | ||
aws_region: | ||
description: 'AWS region for the ECR' | ||
required: false | ||
role_to_assume: | ||
description: 'AWS IAM role to assume' | ||
required: false | ||
aws_account_number: | ||
description: 'AWS Account Number' | ||
required: false | ||
image_name: | ||
description: 'Name of the docker image to update' | ||
required: false | ||
expression: | ||
description: 'Regex expression for image tags' | ||
required: false | ||
page_size: | ||
description: 'Number of tags to return per page' | ||
required: false | ||
default: '100' | ||
github_token: | ||
description: 'Token to use for GitHub API, in most cases github.token' | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Checkout the Repo | ||
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 | ||
with: | ||
aws-region: ${{ inputs.aws_region }} | ||
role-to-assume: ${{ inputs.role_to_assume }} | ||
role-duration-seconds: 3600 | ||
- name: Login to Amazon ECR | ||
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1 | ||
with: | ||
mask-password: 'true' | ||
env: | ||
AWS_REGION: ${{ inputs.aws_region }} | ||
- name: Update images | ||
shell: bash | ||
env: | ||
GHCR_TOKEN: ${{ inputs.github_token }} | ||
run: | | ||
# Update images | ||
# Change to the directory where the action is stored | ||
cd ${{ github.action_path }} | ||
if [[ -z "${{ inputs.image_name }}" ]]; then | ||
./scripts/update_mirrors.sh ${{ inputs.aws_account_number }}.dkr.ecr.${{ inputs.aws_region }}.amazonaws.com | ||
else | ||
# Update ${{ inputs.image_name }} | ||
./scripts/update_mirrors.sh ${{ inputs.aws_account_number }}.dkr.ecr.${{ inputs.aws_region }}.amazonaws.com ${{ inputs.image_name }} '${{ inputs.expression }}' ${{ inputs.page_size }} | ||
fi |
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,5 @@ | ||
[ | ||
"gcr.io/prysmaticlabs/prysm/beacon-chain:v4.1.1", | ||
"gcr.io/prysmaticlabs/prysm/validator:v4.1.1", | ||
"protolambda/eth2-val-tools:latest" | ||
] |
Oops, something went wrong.