Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d801a9e
Added labels to forms
alfetopito Feb 23, 2023
c7772b9
Added workflows to process images and issue requests
alfetopito Feb 23, 2023
cb5cf1f
35/automate forms - WIP (#52)
alfetopito Feb 24, 2023
6f13490
Cannot reference envs being defined at the same time
alfetopito Feb 24, 2023
0a764f0
`env` context is not available on `jobs.<job>.env` context :/
alfetopito Feb 24, 2023
cf0c8a9
Commenting out all outputs from subworkflow
alfetopito Feb 24, 2023
be908cc
Download image after repo has been checked out
alfetopito Feb 24, 2023
31f2f68
Reviewers are not working. Temporarily commenting it out
alfetopito Feb 24, 2023
ae4cc0f
Don't assign to anyone nor set any reviewer
alfetopito Feb 24, 2023
c50f712
Added error handling commenting and closing original issue
alfetopito Feb 24, 2023
98fe7d4
35/automate forms add tokens (#65)
alfetopito Feb 24, 2023
f12c01d
Updated regex for extracting full data from issue
alfetopito Feb 24, 2023
b06781a
Depending how you edit stuff on GH it adds a `\n` or `\r\n` new line
alfetopito Feb 24, 2023
8bbab2e
Updated python script to not throw when key is missing
alfetopito Feb 27, 2023
70eb979
Added `remoteToken` action
alfetopito Feb 27, 2023
6518115
Truncating file before updating to avoid leftover data
alfetopito Feb 27, 2023
7679189
Adding markdown to user provided reason
alfetopito Feb 27, 2023
86f516b
Typo 🤦
alfetopito Feb 27, 2023
b137b6d
Adding msg to original issue at the start for early feedback
alfetopito Feb 27, 2023
8f2c936
Experimenting with new subworkflow for all actions
alfetopito Feb 27, 2023
7ebe273
Cleaned up workflow files
alfetopito Feb 27, 2023
1f93778
Auto-assign PRs to @cowprotocol/token-masters
alfetopito Feb 28, 2023
ab6ea67
It must be a list comma or new line separated...
alfetopito Feb 28, 2023
f0adff1
Seems like team reviewers is not working
alfetopito Feb 28, 2023
3562c46
Update images (#44)
alfetopito Mar 1, 2023
f215588
Only trigger workflow if one of the required labels is set
alfetopito Mar 1, 2023
77a22b6
It doesn't require ALL labels to be present, just one of them
alfetopito Mar 2, 2023
bd12c29
Added `other` issue template
alfetopito Mar 2, 2023
cd4f691
Restructure image folders (#89)
alfetopito Mar 6, 2023
8ca81e6
Update readme (#90)
alfetopito Mar 6, 2023
944e99b
[addToken] MAINNET/0xfcf8eda095e37a41e002e266daad7efc1579bc0a (#113)
github-actions[bot] Mar 7, 2023
a605c62
Use number type for decimals (#121)
fedgiac Mar 14, 2023
6074c45
[addToken] `BZZ` to `MAINNET` (#117)
github-actions[bot] Mar 22, 2023
cc02163
[addToken] MAINNET/0xE95A203B1a91a908F9B9CE46459d101078c2c3cb (#120)
github-actions[bot] Mar 22, 2023
8592622
[addToken] MAINNET/0xB50721BCf8d664c30412Cfbc6cf7a15145234ad1 (#126)
github-actions[bot] Mar 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/addImageForm.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Add Image
description: Creates a request to add a token image to CoW Swap's image repository
title: "[AddImage] `SYMBOL` on `NETWORK`"
labels: []
labels: [addImage]

body:
- type: markdown
Expand Down
5 changes: 3 additions & 2 deletions .github/ISSUE_TEMPLATE/addTokenForm.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Add Token
description: Creates a request to add a token to CoW Swap's default token list
title: "[AddToken] `SYMBOL` on `NETWORK`"
labels: []
labels: [addToken]

body:
- type: markdown
Expand Down Expand Up @@ -65,6 +65,7 @@ body:
- type: textarea
id: reason
attributes:
label: Why should we add this token? How do we know it's not a scam? Does it have enough liquidity on selected chain?
label: Reason
description: Why should we add this token? How do we know it's not a scam? Does it have enough liquidity on selected chain?
validations:
required: true
9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATE/other.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: Other
about: Describe this issue template's purpose here.
title: ''
assignees: ''

---


5 changes: 3 additions & 2 deletions .github/ISSUE_TEMPLATE/removeTokenForm.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Remove Token
description: Creates a request to remove a token from CoW Swap's default token list
title: "[RemoveToken] `SYMBOL` on `NETWORK`"
labels: []
labels: [removeToken]

body:
- type: markdown
Expand Down Expand Up @@ -36,6 +36,7 @@ body:
- type: textarea
id: reason
attributes:
label: Why should we remove this token?
label: Reason
description: Why should we remove this token?
validations:
required: true
102 changes: 102 additions & 0 deletions .github/workflows/executeAction.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: ExecuteAction

on:
workflow_call:
inputs:
issueInfo:
required: true
type: string
operation:
required: true
type: string
prTitle:
required: true
type: string
prBody:
required: true
type: string

env:
IMAGES_BASE_PATH: src/public/images/
LIST_PATH: src/public/CowSwap.json

jobs:
execute:
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v3

- name: Set BASE_PATH env var
run: echo "BASE_PATH=${{ env.IMAGES_BASE_PATH }}${{ fromJSON(inputs.issueInfo).chainId }}/${{ fromJSON(inputs.issueInfo).address }}/" >> "$GITHUB_ENV"

- name: Create base path and info.json if it doesn't exist
run: |
mkdir -p ${{ env.BASE_PATH }}
touch "${{ env.BASE_PATH }}info.json"

- name: Save input into local file
run: |
cat << EOF > data.json
${{ inputs.issueInfo }}
EOF

# Image handling
- name: Download image
if: ${{ inputs.operation == 'addImage' || inputs.operation == 'addToken' }}
uses: actions/download-artifact@v3
with:
name: ${{ fromJSON(inputs.issueInfo).address }}

- name: Move image to destination
if: ${{ inputs.operation == 'addImage' || inputs.operation == 'addToken' }}
run: mv output.png ${{ env.BASE_PATH }}logo.png

- name: Update json files
run: python3 src/scripts/workflow_helper.py ${{ inputs.operation }} data.json

- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
commit-message: "[${{ inputs.operation }}] ${{ fromJSON(inputs.issueInfo).network }}/${{ fromJSON(inputs.issueInfo).address }}"
branch: ${{ inputs.operation }}/${{ fromJSON(inputs.issueInfo).chainId }}_${{ fromJSON(inputs.issueInfo).address }}
delete-branch: true
title: ${{ inputs.prTitle }}
body: |
# ${{ inputs.operation }}

**Note** This is an automated PR

Submitted by @${{ github.event.issue.user.login }}

Closes #${{ github.event.issue.number }}

---

${{ inputs.prBody }}
add-paths: |
${{ env.BASE_PATH }}/*
${{ env.LIST_PATH }}

- name: Comment on issue
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ github.event.issue.number }}
body: |
Your request is ready and will be reviewed by a team member.
You can follow the progress in the Pull Request #${{ steps.cpr.outputs.pull-request-number }}

- name: Report error
if: ${{ failure() }}
uses: peter-evans/close-issue@v2
with:
comment: |
Failed to ${{ inputs.operation }}

Check the input is correct and try again in a new issue

If the issue persists, create a bug report

cc @cowprotocol/frontend
54 changes: 54 additions & 0 deletions .github/workflows/optimizeImage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: OptimizeImage

# Input: chain, address, CID
# Steps:
# - resolve image/download it
# - optimize image: 256x256, remove metadata
# - upload new image to ipfs: name file <address>.png, upload it
# - return CID

on:
workflow_call:
inputs:
address:
required: true
type: string
url:
required: true
type: string

jobs:
execute:
runs-on: ubuntu-latest
steps:
- name: Download image
run: "curl -o image.png ${{ inputs.url }}"

- name: Install imagemagick
run: sudo apt install imagemagick

- name: Optimize image
run: "convert image.png -depth 7 -resize 256x -posterize 24 output.png"

# - name: Further compress image
# run: "??? still need to figure out how to do this without imageoptim"

- name: Upload img
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.address }}
path: output.png
retention-days: 1

- name: Report error
if: ${{ failure() }}
uses: peter-evans/close-issue@v2
with:
comment: |
Failed to optimize image

Check you provided a proper image file and try again in a new issue

If the issue persists, create a bug report

cc @cowprotocol/frontend
Loading