update magnet #33
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: "Handle Rococo Slot Request" | |
on: | |
issues: | |
types: [labeled] | |
workflow_dispatch: | |
inputs: | |
issue_number: | |
description: 'Number of the issue to use as source' | |
type: string | |
required: true | |
jobs: | |
run: | |
runs-on: macos-latest | |
if: github.event.label.name == 'Rococo' | |
steps: | |
- name: Checkout # Clone git repository | |
uses: actions/checkout@v3 | |
- name: Install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- uses: stefanbuck/github-issue-parser@v3 | |
id: issue-parser | |
with: | |
template-path: .github/ISSUE_TEMPLATE/rococo.yaml # optional but recommended | |
- run: cat ${HOME}/issue-parser-result.json | |
- name: Run CLI App | |
id: onboard | |
working-directory: cli | |
env: | |
PARA_ID: ${{ steps.issue-parser.outputs.issueparser_para_id }} | |
MANAGER_ACCOUNT: ${{ steps.issue-parser.outputs.issueparser_manager_account }} | |
GENESIS: ${{ steps.issue-parser.outputs.issueparser_genesis }} | |
WASM: ${{ steps.issue-parser.outputs.issueparser_wasm }} | |
SUDO_ACCOUNT: ${{ secrets.SUDO_ACCOUNT }} | |
SEED: ${{ secrets.SEED }} | |
FAUCET_ADDRESS: ${{ secrets.FAUCET_ADDRESS }} | |
ROCOCO_URI: ${{ secrets.ROCOCO_URI }} | |
run: cargo run $PARA_ID $MANAGER_ACCOUNT -g $GENESIS -v $WASM | |
- name: Generate token | |
id: generate_token | |
uses: tibdex/github-app-token@v1 | |
with: | |
app_id: ${{ secrets.APP_ID }} | |
private_key: ${{ secrets.APP_KEY }} | |
- name: Close issue | |
if: steps.onboard.outcome == 'success' | |
run: gh issue close ${{ github.event.issue.number }} -r completed -c "Parachain is now being onboarded." | |
env: | |
GH_TOKEN: ${{ steps.generate_token.outputs.token }} | |
comment_failure: | |
runs-on: macos-latest | |
needs: [run] | |
permissions: | |
issues: write | |
if: ${{ always() && contains(needs.*.result, 'failure') }} | |
steps: | |
- name: Post comment | |
run: gh issue comment ${{ github.event.issue.number }} --body "Something went wrong during the onboarding process, @AlexD10S \n This is an automated message. " | |
env: | |
GH_TOKEN: ${{ github.token }} |