Skip to content

Auto Sign and Merge Update #10571

Auto Sign and Merge Update

Auto Sign and Merge Update #10571

Workflow file for this run

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Auto Sign and Merge Update
concurrency:
group: ${{github.workflow}}
cancel-in-progress: true
on:
workflow_dispatch: # via manual trigger
schedule:
- cron: "47 * * * *" # every hour on the 47th minute to avoid high load 0 times
env:
BRANCH_PREFIX: auto-signed
RUST_LOG: debug
jobs:
auto-sign:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: πŸ›Ž Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: πŸ”§ Install Rust dependencies
uses: ./.github/workflows/rust-install
- name: Check out PR branch if it already exists
id: checkout-pr-branch
run: |
AUTO_SIGNED_BRANCH=$(git branch -r --list "origin/$BRANCH_PREFIX-*" --sort=-refname | head -n 1)
if [ -z "$AUTO_SIGNED_BRANCH" ]
then
hasbranch='false'
else
git checkout --track $AUTO_SIGNED_BRANCH
hasbranch='true'
fi
echo "hasbranch=$hasbranch" >> $GITHUB_OUTPUT
- name: βš™ Clean metadata-cli
run: cargo clean --release
- name: βš™ Autosign QRs from RPC nodes
env:
SIGNING_SEED_PHRASE: ${{secrets.SIGNING_SEED_PHRASE}}
run: cargo run --release -- auto-sign --source node
# Skip Github releases for now as the UI doesn't support future metadata anymore
# - name: βš™ Autosign QRs from GitHub releases
# env:
# SIGNING_SEED_PHRASE: ${{secrets.SIGNING_SEED_PHRASE}}
# run: cargo run --release -- auto-sign --source github
- name: βš™ Run Collector
run: cargo run --release -- collect
- name: βš™ Run Cleaner
run: cargo run --release -- clean
- name: πŸ“Œ Commit changes if PR branch exists
if: ${{ steps.checkout-pr-branch.outputs.hasbranch == 'true' }}
uses: ./.github/workflows/commit-changes
with:
message: "metadata update"
- name: Create name for new PR branch if it doesn't already exist
if: ${{ steps.checkout-pr-branch.outputs.hasbranch == 'false' }}
id: new-branch
run: |
branchname="$BRANCH_PREFIX-$(date '+%Y-%m-%d')"
echo "branchname=$branchname" >> $GITHUB_OUTPUT
- name: Create PR branch if it doesn't already exist
if: ${{ steps.checkout-pr-branch.outputs.hasbranch == 'false' }}
id: cpr
uses: peter-evans/create-pull-request@c55203cfde3e5c11a452d352b4393e68b85b4533
with:
commit-message: add signed QR image files
branch: ${{ steps.new-branch.outputs.branchname }}
delete-branch: true
base: main
title: "[Automated] Updated signed metadata QR image files"
body: |
If the Metadata Portal needs updated data, inspect the data.json file to determine whether it is correct and then merge this PR.
draft: false
reviewers: |
wilwade
shannonwells
enddynayn
aramikm