forked from MetaMask/metamask-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (33 loc) · 1.18 KB
/
monitor-releases.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Monitor Upstream Releases
on:
schedule:
- cron: '*/30 * * * *' # Check every 30 minutes
jobs:
check-releases:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PAT_TOKEN }}
- name: Check for new releases
env:
GH_TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
# Get latest upstream release using gh cli
LATEST_RELEASE=$(gh api \
repos/MetaMask/metamask-extension/releases/latest \
--jq .tag_name)
echo "Latest upstream release: $LATEST_RELEASE"
# Check if we already have this release
if gh release view "${LATEST_RELEASE}-no-lavamoat" --repo ${{ github.repository }} &>/dev/null; then
echo "Release ${LATEST_RELEASE}-no-lavamoat already exists. Skipping."
exit 0
fi
# If we don't have the release, trigger the build
gh api \
repos/${{ github.repository }}/dispatches \
-X POST \
-F event_type=upstream-release \
-F client_payload="{\"release\":\"$LATEST_RELEASE\"}"