Skip to content

Internal Snapshot S3 Reset #112

Internal Snapshot S3 Reset

Internal Snapshot S3 Reset #112

name: Internal Snapshot S3 Reset
on:
workflow_dispatch:
inputs:
chain:
required: true
description: 'chain'
default: 'odin-internal'
type: choice
options:
- internal-all
- odin-internal
- heimdall-internal
- thor-internal
- preview-all
- odin-preview
- heimdall-preview
concurrency:
group: release
jobs:
set-targets:
runs-on: ubuntu-latest
outputs:
snapshot_chains: ${{ steps.set-matrix.outputs.snapshot_chains }}
bridge_chains: ${{ steps.set-matrix.outputs.bridge_chains }}
steps:
- id: set-matrix
run: |
INTERNAL_ALL='[ "odin", "heimdall", "thor" ]'
PREVIEW_ALL='[ "odin-preview", "heimdall-preview" ]'
INPUT="${{ github.event.inputs.chain }}"
if [[ $INPUT == "internal-all" ]]; then
SNAPSHOT_CHAINS=$INTERNAL_ALL
BRIDGE_CHAINS=$INTERNAL_ALL
elif [[ $INPUT == "preview-all" ]]; then
SNAPSHOT_CHAINS=$PREVIEW_ALL
BRIDGE_CHAINS=$PREVIEW_ALL
else
CHAIN=${INPUT%"-internal"}
SNAPSHOT_CHAINS="[ \"$CHAIN\" ]"
if [[ $CHAIN == odin* ]]; then
ALL=$([[ $CHAIN != *-preview ]] && echo $INTERNAL_ALL || echo $PREVIEW_ALL)
BRIDGE_CHAINS=$(echo $ALL | sed -r 's/\"odin(-preview)?\", //')
else
BRIDGE_CHAINS=$SNAPSHOT_CHAINS
fi
fi
echo "snapshot_chains={\"include\":$(echo $SNAPSHOT_CHAINS)}" >> $GITHUB_OUTPUT
echo "bridge_chains={\"include\":$(echo $BRIDGE_CHAINS)}" >> $GITHUB_OUTPUT
reset-snapshot:
needs: [set-targets]
strategy:
matrix: ${{ fromJson(needs.set-targets.outputs.snapshot_chains) }}
runs-on: ubuntu-latest
environment:
name: internal
steps:
- uses: actions/checkout@v3
- name: reset internal snapshot
run: |
echo "y" | bash .github/scripts/reset-snapshot.sh ${{ matrix }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
reset-bridge-service:
needs: [reset-snapshot, set-targets]
strategy:
matrix: ${{ fromJson(needs.set-targets.outputs.bridge_chains) }}
uses: ./.github/workflows/reset-bridge-service.yaml

Check failure on line 77 in .github/workflows/snapshot-reset.yaml

View workflow run for this annotation

GitHub Actions / Internal Snapshot S3 Reset

Invalid workflow file

The workflow is not valid. In .github/workflows/snapshot-reset.yaml (Line: 77, Col: 11): Error from called workflow planetarium/9c-infra/.github/workflows/reset-bridge-service.yaml@d939c23ea074e521719884ab804cc16257186f9d: Anchors are not currently supported. Remove the anchor 'workflow-inputs'
with:
network: ${{ matrix }}