Discord workflow (blacktop/ipsw)
The Discord workflow from blacktop/ipsw, explained and optimized by Latchkey.
A
CI health: A - excellent
Point runs-on at Latchkey and get job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the Discord workflow from the blacktop/ipsw repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
workflow (.yml)
name: "Discord"
on:
workflow_dispatch:
inputs:
skip_post:
description: "Skip posting to Social Media"
required: false
type: boolean
schedule:
# - cron: "0 */1 * * *" # every 1 hour
- cron: "*/30 * * * *" # every 30 minutes
# - cron: "0 0 * * *"
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Check Cache
run: |
cat hack/.watch_cache || echo "No cache found"
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.26"
- name: Run ipsw watch WebKit/WebKit (Security Features)
run: |
go run ./cmd/ipsw/main.go watch WebKit/WebKit --pattern '(?i)Lockdown Mode|Memory Tagging|EnhancedSecurity|Enhanced Security|(?-i:MTE)' --days 1 \
--cache hack/.watch_cache \
--api ${{ secrets.GITHUB_TOKEN }} \
--discord \
--discord-id ${{ secrets.DISCORD_ID }} \
--discord-token ${{ secrets.DISCORD_TOKEN }} \
--discord-icon "https://raw.githubusercontent.com/blacktop/ipsw/master/www/static/img/webkit.png"
- name: Run ipsw watch WebKit/WebKit tags
if: ${{ !inputs.skip_post }}
run: |
go run ./cmd/ipsw/main.go watch WebKit/WebKit --tags \
--cache hack/.watch_cache \
--api ${{ secrets.GITHUB_TOKEN }} \
--discord \
--discord-id ${{ secrets.DISCORD_ID }} \
--discord-token ${{ secrets.DISCORD_TOKEN }} \
--discord-icon "https://raw.githubusercontent.com/blacktop/ipsw/master/www/static/img/webkit.png"
- name: Run ipsw watch apple-oss-distributions/distribution-macOS
if: ${{ !inputs.skip_post }}
run: |
go run ./cmd/ipsw/main.go watch apple-oss-distributions/distribution-macOS --tags --post \
--cache hack/.watch_cache \
--api ${{ secrets.GITHUB_TOKEN }} \
--discord \
--discord-id ${{ secrets.DISCORD_ID }} \
--discord-token ${{ secrets.DISCORD_TOKEN }} \
--discord-icon "https://avatars.githubusercontent.com/u/91919287"
# --mastodon \
# --mastodon-client-id ${{ secrets.MASTODON_CLIENT_ID }} \
# --mastodon-client-secret ${{ secrets.MASTODON_CLIENT_SECRET }} \
# --mastodon-access-token ${{ secrets.MASTODON_ACCESS_TOKEN }}
- name: Run ipsw watch apple-oss-distributions/distribution-macOS (SKIP MASTODON)
if: ${{ inputs.skip_post }}
run: |
go run ./cmd/ipsw/main.go watch apple-oss-distributions/distribution-macOS --tags --post \
--cache hack/.watch_cache \
--api ${{ secrets.GITHUB_TOKEN }} \
--discord \
--discord-id ${{ secrets.DISCORD_ID }} \
--discord-token ${{ secrets.DISCORD_TOKEN }} \
--discord-icon "https://avatars.githubusercontent.com/u/91919287"
# --mastodon \
# --mastodon-client-id ${{ secrets.MASTODON_CLIENT_ID }} \
# --mastodon-client-secret ${{ secrets.MASTODON_CLIENT_SECRET }} \
# --mastodon-access-token ${{ secrets.MASTODON_ACCESS_TOKEN }}
- uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v5
with:
commit_message: Update .watch_cache
# - name: Commit Cache Changes
# run:
# if [[ -n $(git status --porcelain) ]]; then
# git config --global user.email "github-actions[bot]@users.noreply.github.com"
# git config --global user.name "github-actions[bot]"
# git add hack/.watch_cache
# git commit -m "Update .watch_cache"
# git push
# fi
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: "Discord" on: workflow_dispatch: inputs: skip_post: description: "Skip posting to Social Media" required: false type: boolean schedule: # - cron: "0 */1 * * *" # every 1 hour - cron: "*/30 * * * *" # every 30 minutes # - cron: "0 0 * * *" permissions: contents: write jobs: build: timeout-minutes: 30 runs-on: latchkey-small steps: - name: Checkout uses: actions/checkout@v7 with: fetch-depth: 0 - name: Check Cache run: | cat hack/.watch_cache || echo "No cache found" - name: Set up Go uses: actions/setup-go@v6 with: go-version: "1.26" - name: Run ipsw watch WebKit/WebKit (Security Features) run: | go run ./cmd/ipsw/main.go watch WebKit/WebKit --pattern '(?i)Lockdown Mode|Memory Tagging|EnhancedSecurity|Enhanced Security|(?-i:MTE)' --days 1 \ --cache hack/.watch_cache \ --api ${{ secrets.GITHUB_TOKEN }} \ --discord \ --discord-id ${{ secrets.DISCORD_ID }} \ --discord-token ${{ secrets.DISCORD_TOKEN }} \ --discord-icon "https://raw.githubusercontent.com/blacktop/ipsw/master/www/static/img/webkit.png" - name: Run ipsw watch WebKit/WebKit tags if: ${{ !inputs.skip_post }} run: | go run ./cmd/ipsw/main.go watch WebKit/WebKit --tags \ --cache hack/.watch_cache \ --api ${{ secrets.GITHUB_TOKEN }} \ --discord \ --discord-id ${{ secrets.DISCORD_ID }} \ --discord-token ${{ secrets.DISCORD_TOKEN }} \ --discord-icon "https://raw.githubusercontent.com/blacktop/ipsw/master/www/static/img/webkit.png" - name: Run ipsw watch apple-oss-distributions/distribution-macOS if: ${{ !inputs.skip_post }} run: | go run ./cmd/ipsw/main.go watch apple-oss-distributions/distribution-macOS --tags --post \ --cache hack/.watch_cache \ --api ${{ secrets.GITHUB_TOKEN }} \ --discord \ --discord-id ${{ secrets.DISCORD_ID }} \ --discord-token ${{ secrets.DISCORD_TOKEN }} \ --discord-icon "https://avatars.githubusercontent.com/u/91919287" # --mastodon \ # --mastodon-client-id ${{ secrets.MASTODON_CLIENT_ID }} \ # --mastodon-client-secret ${{ secrets.MASTODON_CLIENT_SECRET }} \ # --mastodon-access-token ${{ secrets.MASTODON_ACCESS_TOKEN }} - name: Run ipsw watch apple-oss-distributions/distribution-macOS (SKIP MASTODON) if: ${{ inputs.skip_post }} run: | go run ./cmd/ipsw/main.go watch apple-oss-distributions/distribution-macOS --tags --post \ --cache hack/.watch_cache \ --api ${{ secrets.GITHUB_TOKEN }} \ --discord \ --discord-id ${{ secrets.DISCORD_ID }} \ --discord-token ${{ secrets.DISCORD_TOKEN }} \ --discord-icon "https://avatars.githubusercontent.com/u/91919287" # --mastodon \ # --mastodon-client-id ${{ secrets.MASTODON_CLIENT_ID }} \ # --mastodon-client-secret ${{ secrets.MASTODON_CLIENT_SECRET }} \ # --mastodon-access-token ${{ secrets.MASTODON_ACCESS_TOKEN }} - uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v5 with: commit_message: Update .watch_cache # - name: Commit Cache Changes # run: # if [[ -n $(git status --porcelain) ]]; then # git config --global user.email "github-actions[bot]@users.noreply.github.com" # git config --global user.name "github-actions[bot]" # git add hack/.watch_cache # git commit -m "Update .watch_cache" # git push # fi
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - Add a job timeout so a hung step cannot burn hours of runner time.
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.