Self updating repository to store Google Chrome release and version info as JSON.
Windows | macOS | Linux | Android |
---|---|---|---|
Use a CDN to fetch the data as needed, examples:
The ./data
directory contains the JSON files:
dev
and stable
)windows
, mac
, linux
, android
)all
Info
latest.json
or list.json
Version
latest.json
or list.json
Unfortunately Github Actions has no broadcasting feature and this repo can only dispatch to manually defined repos.
As a workaround you can add a new workflow that will poll the JSON file relevant to you recurringly (using a cron trigger), hash the data and use Github's built-in caching feature to understand if a change happened and your other workflow should be triggered.
Note:
Prerequisites:
workflow_call
trigger:on:
workflow_call:
Save the below workflow as .github/workflows/check-chrome-versions.yml
in you repo:
name: "[cron] Check chrome versions"
on:
workflow_dispatch:
schedule:
- cron: "0 * * * *" # https://crontab.guru/every-1-hour
jobs:
check-versions:
runs-on: ubuntu-latest
outputs:
cache-hit: ${{ steps.cache.outputs.cache-hit }}
env:
# You can use any JSON file here
CHROME_VERSION_URL: "https://cdn.jsdelivr.net/gh/berstend/chrome-versions/data/stable/all/version/latest.json"
steps:
- name: Get hash of chrome versions
id: get-versions
run: |
json=$(curl -s ${{ env.CHROME_VERSION_URL }})
echo json: ${json}
hash=$(echo -n $json | md5sum)
echo hash: ${hash}
echo "::set-output name=hash::$hash"
shell: bash
- name: Setup cache based on hash
id: cache
uses: actions/cache@v3
with:
path: ~/cache-chrome-version # no-op
key: chrome-${{ steps.get-versions.outputs.hash }}
- name: "Cache hit: Exit"
if: steps.cache.outputs.cache-hit == 'true'
run: echo "cache hit, no new chrome versions"
trigger-workflow:
if: needs.check-versions.outputs.cache-hit != 'true'
needs: check-versions
uses: ./.github/workflows/build.yml # Change this to your target workflow
Change ./.github/workflows/build.yml
to whatever workflow you want to trigger on new chrome versions.
Troubleshooting:
data
├── dev
│ ├── all
│ │ ├── info
│ │ │ ├── latest.json
│ │ │ └── list.json
│ │ └── version
│ │ ├── latest.json
│ │ └── list.json
│ ├── android
│ │ ├── info
│ │ │ ├── latest.json
│ │ │ └── list.json
│ │ └── version
│ │ ├── latest.json
│ │ └── list.json
│ ├── linux
│ │ ├── info
│ │ │ ├── latest.json
│ │ │ └── list.json
│ │ └── version
│ │ ├── latest.json
│ │ └── list.json
│ ├── mac
│ │ ├── info
│ │ │ ├── latest.json
│ │ │ └── list.json
│ │ └── version
│ │ ├── latest.json
│ │ └── list.json
│ └── windows
│ ├── info
│ │ ├── latest.json
│ │ └── list.json
│ └── version
│ ├── latest.json
│ └── list.json
└── stable
├── all
│ ├── info
│ │ ├── latest.json
│ │ └── list.json
│ └── version
│ ├── latest.json
│ └── list.json
├── android
│ ├── info
│ │ ├── latest.json
│ │ └── list.json
│ └── version
│ ├── latest.json
│ └── list.json
├── linux
│ ├── info
│ │ ├── latest.json
│ │ └── list.json
│ └── version
│ ├── latest.json
│ └── list.json
├── mac
│ ├── info
│ │ ├── latest.json
│ │ └── list.json
│ └── version
│ ├── latest.json
│ └── list.json
└── windows
├── info
│ ├── latest.json
│ └── list.json
└── version
├── latest.json
└── list.json
MIT