-
Notifications
You must be signed in to change notification settings - Fork 960
69 lines (64 loc) · 2.38 KB
/
automation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Automation Tasks
on:
issue_comment:
types: [created]
permissions:
id-token: write
contents: write
pull-requests: write
env:
GIT_LFS_SKIP_SMUDGE: 1
jobs:
with_py: # tasks that are using python scripts from anoma-ci-iac
if: ${{ github.event.issue.pull_request }}
runs-on: ${{ matrix.os }}
timeout-minutes: ${{ matrix.make.timeout }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
make:
- name: Update wasm
comment: pls update wasm
command: update-wasm.py
logs: 'false'
timeout: 15
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::375643557360:role/anoma-github-action-ci-master
aws-region: eu-west-1
- uses: khan/[email protected]
id: check
with:
trigger: ${{ matrix.make.comment }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: xt0rted/pull-request-comment-branch@v1
if: steps.check.outputs.triggered == 'true'
id: comment-branch
- uses: actions/checkout@v4
if: steps.check.outputs.triggered == 'true'
with:
ref: ${{ steps.comment-branch.outputs.head_ref }}
- name: Run task ${{ matrix.make.name }}
if: steps.check.outputs.triggered == 'true'
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
pip3 install ghapi boto3 toml requests py-markdown-table >/dev/null 2>&1
aws s3 cp s3://$CHAIN_BUCKET/scripts/${{ matrix.make.command }} .github/workflows/scripts/
python3 .github/workflows/scripts/${{ matrix.make.command }}
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_READ_ORG_TOKEN: ${{ secrets.GT_READ_ORG }}
GITHUB_DISPATCH_TOKEN: ${{ secrets.GT_DISPATCH }}
SLACK_DEVNET_SECRET: ${{ secrets.SLACK_DEVNET_SECRET }}
BINARIES_COMMIT_SHA: ${{ steps.comment-branch.outputs.head_sha }}
- name: Comment not found
if: steps.check.outputs.triggered != 'true'
run: echo "Comment \"$COMMENT\" not matched"
env:
COMMENT: ${{ matrix.make.comment }}