Repository navigation
45 lines (40 loc) · 1.61 KB
/
Copy pathchangeset-version.yaml
File metadata and controls
45 lines (40 loc) · 1.61 KB
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
39
40
41
42
43
44
45
on:
workflow_call:
outputs:
version:
description: 'The Hive package version'
value: ${{ jobs.changeset-version.outputs.version }}
jobs:
changeset-version:
runs-on: ubuntu-22.04
outputs:
version: ${{ steps.package-version.outputs.version }}
steps:
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4
with:
persist-credentials: false
# `changeset version` walks git history to find the commit that added
# each changeset. On a shallow clone it deepens via `git fetch --deepen`
# in a loop, which intermittently stalls and hangs the job. Full history
# skips that path; blob:none keeps the download to the ~14 MiB commit/tree
# graph instead of ~394 MiB, since the file blobs are never needed here.
fetch-depth: 0
filter: blob:none
- name: setup environment
uses: ./.github/actions/setup
with:
actor: changeset-version
- name: Apply changeset version
# @changesets/changelog-github hits the GitHub API per changeset; a GitHub
# API incident makes this hang indefinitely (nominal run is ~1 min), so fail
# fast instead of holding the runner for the whole workflow timeout.
timeout-minutes: 10
run: pnpm changeset version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get Version from package.json
id: package-version
run: |
VERSION=$(jq -r '.version' deployment/package.json)
echo "version=$VERSION" >> $GITHUB_OUTPUT