How can I get Slack notifications when a new version of Playwright is released?

Share

One of the many reasons I'm in love with Playwright is the constant updates the tool receives. With these frequent releases there may be a few days or weeks where I may miss out on the latest features that are available. To remedy this problem I created a 'Version-Checker' github repository. The goal was create automation that monitors the github releases page, and alerts me within a day via Slack when a new version is released.

GitHub - BMayhew/version-checker: A small repo with github action for checking github releases and notifying via slack
A small repo with github action for checking github releases and notifying via slack - GitHub - BMayhew/version-checker: A small repo with github action for checking github releases and notifying v...

The version-checker has a readme which walks you through how to set this up in your team or personal slack channel. You will need to have administrative access to add a Slack app, and be able to create a github actions secret for the webhook url. When creating the Slack app you can also customize to your liking.

The github-action.yml is straight forward

on:
  workflow_dispatch:
  schedule:
    # Run at 12:05 Monday - Fridays
    - cron:  '05 12 * * 1-5'

name: Version Checker

jobs:
  simple-check-playwright:
    runs-on: ubuntu-latest
    steps:
      - name: Simplify Fetch Data
        run: curl -s GET https://api.github.com/repos/microsoft/playwright/tags\?per_page\=1 | jq -r '.[].name' > version.txt
    
      - name: Save Version as Variable
        id: version_variable
        run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV
     
      - name: Cache playwright version number
        uses: actions/cache@v3
        id: playwright-version
        with:
          path: |
            ./version.txt
          key: playwright-${{ env.VERSION }}

      - name: Notify if version.txt has changed
        if: steps.playwright-version.outputs.cache-hit != 'true'
        uses: 8398a7/action-slack@v3
        with:
          text: 'A new version of Playwright has been released! https://github.com/microsoft/playwright/releases/tag/${{ env.VERSION }}'
          status: ${{ job.status }}
          fields: workflow
        env:
          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

You will need to create a SLACK_WEBHOOK_URL as a github secret. Once set you will receive a Slack notification if there is a new version of Playwright Released within a working business day.