Fix P-OPS Team Mainnet Seed and Peer #532
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
name: Validate Gentx | |
on: | |
pull_request: | |
jobs: | |
find-gentx-files: | |
runs-on: ubuntu-latest | |
outputs: | |
gentx-files: ${{ steps.set-outputs.outputs.gentx-files }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get changed gentx files | |
id: changed-files | |
uses: tj-actions/changed-files@v39 | |
with: | |
files: "./celestia/*gentx*/*.json" | |
- name: Set outputs | |
id: set-outputs | |
run: | | |
echo "gentx-files=${{ steps.changed-files.outputs.all_changed_files }}" >> "$GITHUB_OUTPUT" | |
jq-format: | |
needs: find-gentx-files | |
runs-on: ubuntu-latest | |
if: ${{ needs.find-gentx-files.outputs.gentx-files != '' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check gentx files against jq | |
run: | | |
for file in ${{ needs.find-gentx-files.outputs.gentx-files }}; do | |
formatted=$(jq . $file) | |
if [ "$formatted" != "$(cat $file)" ]; then | |
echo "$file gentx file not formatted" | |
echo "expected:" | |
echo "$formatted" | |
echo "found:" | |
cat $file | |
echo "" | |
echo "Hexdump of file:" | |
head -c 100 "$file" | hexdump -C | |
echo "Hexdump of jq output:" | |
echo "$formatted" | head -c 100 | hexdump -C | |
exit 1 | |
fi | |
done | |
valid-gentx: | |
needs: find-gentx-files | |
runs-on: ubuntu-latest | |
if: ${{ needs.find-gentx-files.outputs.gentx-files != '' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21 | |
- name: Validate addresses and a balances | |
run: | | |
for file in ${{ needs.find-gentx-files.outputs.gentx-files }}; do | |
go run .github/workflows/validate.go $file | |
done |