Skip to content

Commit

Permalink
Update github.com/coinbase/waas-client-library-go
Browse files Browse the repository at this point in the history
* right/master:
  Release v1.0.2 (#17)
  Fix GitHub issues workflows (#15)
  Add Github Actions for Issues on repo (#13)
  Update CHANGELOG.md (#12)
  v1.0.1 (#11)
  Release v1.0.0 (#10)
  Release v1.0.0 (#8)
  Release v1.0.0 (#7)
  Bump cryptography from 41.0.5 to 41.0.6 (#6)
  Release v1.0.0 (#5)
  Cleanup and add Unit tests (#4)
  inital commit fix (#2)
  initial commit
  • Loading branch information
urischwartz-cb committed Jan 19, 2024
2 parents c49a7d6 + 8e57279 commit 1e772d3
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and Test

on: [push]

jobs:
format-code:
runs-on: ubuntu-latest

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

- name: Install dependencies and format code
run: |
sudo apt-get install -y make
pip3 install black isort
make format
if git diff --quiet; then
echo "No code formatting changes detected."
else
echo "Code formatting changes detected. Please run 'make format' locally and commit the changes."
git diff --exit-code
exit 1
fi
run-tests:
runs-on: ubuntu-latest

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

- name: Set up Python environment
uses: actions/setup-python@v3
with:
python-version: 3.9

- name: Install dependencies and run tests
run: |
python -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
pip install -r test_requirements.txt
python -m unittest discover -v
17 changes: 17 additions & 0 deletions .github/workflows/issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
on:
issues:
types: [opened]

jobs:
comment:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Thank you for reporting! If this is an SDK specific issue, we will look into it and get back to you soon. If this is an API related request, report it in our [Advanced API forum](https://forums.coinbasecloud.dev/c/advanced-trade-api/20) instead.'
})
61 changes: 61 additions & 0 deletions .github/workflows/notification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Slack notifications for PRs and Issues

on:
issues:
types: [opened, reopened]

env:
CHANNEL_API_FEEDBACK: ${{ vars.CHANNEL_API_FEEDBACK }}
ON_CALL_API: ${{ vars.ON_CALL_API }}

jobs:
checks:
runs-on: ubuntu-latest
outputs:
skip: ${{ env.skip }}
steps:
- name: Check spam labels
if: ${{ contains(github.event.*.labels.*.name, 'spam') }}
run: |
echo "skip=true" >> $GITHUB_ENV
echo "::error:: Spam label found."
notify:
runs-on: ubuntu-latest
needs: checks
if: ${{ needs.checks.outputs.skip != 'true' }}
steps:
- name: Set channel and mention
run: |
echo "channel=${{ env.CHANNEL_API_FEEDBACK }}" >> $GITHUB_ENV
echo "mention=${{ env.ON_CALL_API }}" >> $GITHUB_ENV
- name: Set text
run: |
text=$(echo "${{ vars.SLACK_TEMPLATE }}")
text=${text//'{{event}}'/Issue ${{ env.action }}}
text=${text//'{{author}}'/${{ env.author }}}
text=${text//'{{url}}'/${{ env.url }}}
text=${text//'{{mention}}'/${{ env.mention }}}
text=${text//'{{repo}}'/${{ github.repository }}}
text="${text//$'\r\n'/'\n'}"
text="${text//$'\n'/'\n'}"
echo "text=$text" >> $GITHUB_ENV
env:
action: ${{ github.event.action }}
author: ${{ github.event.issue.user.login }}
url: ${{ github.event.issue.html_url }}

- name: Notify Slack
uses: slackapi/slack-github-action@v1.24.0
with:
payload: |
{
"channel": "#${{ env.channel }}",
"username": "${{ vars.WEBHOOK_USERNAME }}",
"text": "*${{ env.title }}*\n${{ env.text }}",
"icon_emoji": ":${{ vars.ICON_EMOJI }}:"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
title: ${{ github.event.issue.title }}

0 comments on commit 1e772d3

Please sign in to comment.