Check Strava API workflow (stravalib/stravalib)
The Check Strava API workflow from stravalib/stravalib, explained and optimized by Latchkey.
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 Check Strava API workflow from the stravalib/stravalib repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: Check Strava API
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
permissions: {}
jobs:
update-model:
name: Update Model
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Fetch API
run: curl https://developers.strava.com/swagger/swagger.json > src/stravalib/tests/resources/strava_swagger.json
- name: Fetch API Schema
uses: stravalib/strava_swagger2pydantic@d3239d5c8130283ee2d038cfa0845a06f8a4dadb # v1.0.12
with:
model_file: "src/stravalib/strava_model.py"
- name: Create Pull Request
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
add-paths: |
src/stravalib
commit-message: Strava API Change
branch: api-change
delete-branch: true
title: "[CHANGE] Strava API Change"
body: |
There were changes in the Strava API:
[Please edit this comment to indicate what has changed]
- [ ] The changelog is updated (only when necessary)
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Check Strava API on: schedule: - cron: "0 0 * * *" workflow_dispatch: permissions: {} jobs: update-model: timeout-minutes: 30 name: Update Model runs-on: latchkey-small permissions: contents: write pull-requests: write steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Fetch API run: curl https://developers.strava.com/swagger/swagger.json > src/stravalib/tests/resources/strava_swagger.json - name: Fetch API Schema uses: stravalib/strava_swagger2pydantic@d3239d5c8130283ee2d038cfa0845a06f8a4dadb # v1.0.12 with: model_file: "src/stravalib/strava_model.py" - name: Create Pull Request uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 with: add-paths: | src/stravalib commit-message: Strava API Change branch: api-change delete-branch: true title: "[CHANGE] Strava API Change" body: | There were changes in the Strava API: [Please edit this comment to indicate what has changed] - [ ] The changelog is updated (only when necessary)
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.
What Latchkey heals here
This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:
- Network fetches
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.