`linear-release.yaml` fails on every push to `main` ([example](https://github.com/coder/coder/actions/runs/43946040791/job/133575848447)): `access_key input is required`. `LINEAR_ACCESS_KEY` isn't a repository secret anymore, and the `linear` environment that #32238 moves the jobs into has no secrets either, so that PR alone wouldn't fix it. This replaces the push trigger with `workflow_dispatch`, so nothing runs automatically. A manual dispatch doesn't sync either, because every job checks for a push event. The comment at the top says how to turn it back on: store a Linear access key in the `linear` environment, merge #32238 (`environment: linear` on each job), and restore the push trigger. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
111 lines
3.8 KiB
YAML
111 lines
3.8 KiB
YAML
name: Linear Release
|
|
|
|
# Disabled: every job needs LINEAR_ACCESS_KEY, which is not set (the linear environment has no
|
|
# secrets). To turn the sync back on, store a Linear access key in the linear environment, give each
|
|
# job `environment: linear`, and restore the push trigger on main and "release/2.[0-9]+".
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
# Queue rather than cancel so back-to-back pushes to main don't cancel the first sync.
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
sync-main:
|
|
name: Sync issues to next Linear release
|
|
if: github.event_name == 'push' && github.ref_name == 'main'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
|
|
- name: Detect next release version
|
|
id: version
|
|
# Find the highest release/2.X branch (exact pattern, no suffixes
|
|
# like release/2.31_hotfix) and derive the next minor version for
|
|
# the release currently in development on main.
|
|
run: |
|
|
LATEST_MINOR=$(git branch -r | grep -E '^\s*origin/release/2\.[0-9]+$' | \
|
|
sed 's/.*release\/2\.//' | sort -n | tail -1)
|
|
if [ -z "$LATEST_MINOR" ]; then
|
|
echo "No release branch found, skipping sync."
|
|
echo "skip=true" >> "$GITHUB_OUTPUT"
|
|
exit 0
|
|
fi
|
|
NEXT="2.$((LATEST_MINOR + 1))"
|
|
echo "version=$NEXT" >> "$GITHUB_OUTPUT"
|
|
echo "skip=false" >> "$GITHUB_OUTPUT"
|
|
echo "Detected next release: $NEXT"
|
|
|
|
- name: Sync issues
|
|
id: sync
|
|
if: steps.version.outputs.skip != 'true'
|
|
uses: linear/linear-release-action@30f9ae77461ec29f07fffe0c52edd1909bfbb6f5 # v0.18.1
|
|
with:
|
|
access_key: ${{ secrets.LINEAR_ACCESS_KEY }}
|
|
command: sync
|
|
version: ${{ steps.version.outputs.version }}
|
|
name: ${{ steps.version.outputs.version }}
|
|
timeout: 300
|
|
|
|
sync-release-branch:
|
|
name: Sync backports to Linear release
|
|
if: github.event_name == 'push' && startsWith(github.ref_name, 'release/')
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
|
|
- name: Extract release version
|
|
id: version
|
|
# The trigger only allows exact release/2.X branch names.
|
|
run: |
|
|
echo "version=${GITHUB_REF_NAME#release/}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Sync issues
|
|
id: sync
|
|
uses: linear/linear-release-action@30f9ae77461ec29f07fffe0c52edd1909bfbb6f5 # v0.18.1
|
|
with:
|
|
access_key: ${{ secrets.LINEAR_ACCESS_KEY }}
|
|
command: sync
|
|
version: ${{ steps.version.outputs.version }}
|
|
name: ${{ steps.version.outputs.version }}
|
|
timeout: 300
|
|
|
|
code-freeze:
|
|
name: Move Linear release to Code Freeze
|
|
needs: sync-release-branch
|
|
if: >
|
|
github.event_name == 'push' &&
|
|
startsWith(github.ref_name, 'release/') &&
|
|
github.event.created == true
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Extract release version
|
|
id: version
|
|
run: |
|
|
echo "version=${GITHUB_REF_NAME#release/}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Move to Code Freeze
|
|
id: update
|
|
uses: linear/linear-release-action@30f9ae77461ec29f07fffe0c52edd1909bfbb6f5 # v0.18.1
|
|
with:
|
|
access_key: ${{ secrets.LINEAR_ACCESS_KEY }}
|
|
command: update
|
|
stage: Code Freeze
|
|
version: ${{ steps.version.outputs.version }}
|
|
timeout: 300
|
|
|