Skip to content

Give IMAGE_QUALITY a default value #151

Give IMAGE_QUALITY a default value

Give IMAGE_QUALITY a default value #151

Workflow file for this run

name: CI
on:
push:
branches:
- "**"
jobs:
eslint:
name: Eslint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16.x"
cache: "yarn"
- run: yarn install
- run: npx eslint .
prettier:
name: Prettier
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16.x"
cache: "yarn"
- run: yarn install
- run: npx prettier --check .
tests:
name: Run unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16.x"
cache: "yarn"
- run: yarn install
- run: yarn test
notification:
name: Slack notification
runs-on: ubuntu-latest
if: ${{ always() && github.actor != 'dependabot[bot]' }}
needs: [eslint, prettier, tests]
steps:
- name: Send notification
run: |
webhookUrl="${{ secrets.SLACK_WEBHOOK_URL }}"
successText=":octocat: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Build #${{ github.run_number }}> of *${{ github.repository }}@${{ github.ref_name }}* by *${{ github.actor }}* completed successfully."
failureText=":octocat: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Build #${{ github.run_number }}> of *${{ github.repository }}@${{ github.ref_name }}* by *${{ github.actor }}* failed."
cancelledText=":octocat: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Build #${{ github.run_number }}> of *${{ github.repository }}@${{ github.ref_name }}* by *${{ github.actor }}* was cancelled.😥"
status="${{ (contains(needs.*.result, 'cancelled') && 'cancelled') || (contains(needs.*.result, 'failure') && 'failure') || 'success' }}"
if [ "$status" = 'success' ]; then
color='good'
text=$successText
elif [ "$status" = 'failure' ]; then
color='danger'
text=$failureText
elif [ "$status" = "cancelled" ]; then
color='warning'
text=$cancelledText
fi
curl "$webhookUrl" -X "POST" --header "Content-Type: application/json" \
--data "{attachments: [{text: \"$text\", color: \"$color\"}]}"