Skip to content

Commit

Permalink
Merge pull request #3663 from onflow/bastian/get-contracts-action
Browse files Browse the repository at this point in the history
Add a GitHub Action to get all contracts
  • Loading branch information
turbolent authored Oct 31, 2024
2 parents 1b27cc3 + db6236f commit a56e521
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/compatibility-check-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ jobs:
path: |
./tmp/output-old.txt
./tmp/output-new.txt
./tmp/contracts.csv
# Check Diff

Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/get-contracts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Get contracts

on:
workflow_call:
inputs:
chain:
required: true
type: string
secrets:
FLOWDIVER_API_KEY:
required: true

env:
GO_VERSION: '1.22'

concurrency:
group: ${{ github.workflow }}-${{ github.run_id }}-${{ inputs.chain }}
cancel-in-progress: true

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
cache: true

- name: Make output dirs
run: |
mkdir tmp
# Get contracts

- name: Download contracts
env:
FLOWDIVER_API_KEY: ${{ secrets.FLOWDIVER_API_KEY }}
working-directory: ./tools/get-contracts
run: |
go run . --chain=${{ inputs.chain }} --apiKey="$FLOWDIVER_API_KEY" > ../../tmp/contracts.csv
# Upload

- name: Upload
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.chain }}-contracts
path: |
./tmp/contracts.csv

0 comments on commit a56e521

Please sign in to comment.