Skip to content

Commit 2a0875f

Browse files
ci(pricing): update snapshots on push to main and daily instead of hourly (ccusage#1914)
* ci(pricing): update snapshots on push to main and daily instead of hourly Co-authored-by: ryoppippi <[email protected]> * ci(pricing): skip push runs for release and pricing-update commits Co-authored-by: ryoppippi <[email protected]> --------- Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: ryoppippi <[email protected]>
1 parent c74b2dd commit 2a0875f

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

‎.github/workflows/update-pricing.yaml‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
name: update pricing
22

33
on:
4+
push:
5+
branches: [main]
46
schedule:
5-
- cron: '0 * * * *'
7+
- cron: '17 3 * * *'
68
workflow_dispatch:
79

810
permissions: {}
911

10-
# Both legs push to main, so a manual dispatch landing on top of the hourly
11-
# schedule would otherwise race the other run's push.
12+
# Both legs push to main, so overlapping runs from pushes, the schedule, or a
13+
# manual dispatch would otherwise race each other's push.
1214
concurrency:
1315
group: update-pricing
1416
cancel-in-progress: false
1517

1618
jobs:
1719
update-pricing:
1820
name: ${{ matrix.name }}
21+
if: >-
22+
github.event_name != 'push' || !(
23+
startsWith(github.event.head_commit.message, 'chore: release v') ||
24+
startsWith(github.event.head_commit.message, 'chore(pricing): ')
25+
)
1926
runs-on: blacksmith-32vcpu-ubuntu-2404
2027
timeout-minutes: 60
2128
permissions:

‎rust/crates/ccusage-core/src/pricing.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2008,10 +2008,10 @@ impl PricingMap {
20082008
}
20092009

20102010
/// Last-resort rates for models ccusage must always price, used only when
2011-
/// the loaded snapshots miss the key: upstream data is refreshed hourly,
2012-
/// so overwriting it with these frozen numbers would reintroduce stale
2013-
/// prices whenever a vendor changes theirs (OpenAI cut the gpt-5.6 rates
2014-
/// after these were written).
2011+
/// the loaded snapshots miss the key: upstream data is refreshed on every
2012+
/// push to main and daily, so overwriting it with these frozen numbers
2013+
/// would reintroduce stale prices whenever a vendor changes theirs (OpenAI
2014+
/// cut the gpt-5.6 rates after these were written).
20152015
fn put_builtin_pricing(
20162016
&mut self,
20172017
fast_multiplier_overrides: &SpeedMultiplierOverrides,

0 commit comments

Comments
 (0)