Interview Prep/Real-World Interview/Write-a-pipeline tasks

Write a workflow that cuts a release: tag push builds artifacts and creates a GitHub Release.

IntermediateHands-onWrite-a-pipeline tasks
Answer
on:
  push:
    tags: ["v*.*.*"]
permissions:
  contents: write
jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: make dist VERSION=${GITHUB_REF_NAME}
      - run: gh release create "$GITHUB_REF_NAME" dist/* --generate-notes
        env:
          GH_TOKEN: ${{ github.token }}

Key trick → GITHUB_REF_NAME is the tag name (e.g. v1.4.2). Creating releases needs contents: write. --generate-notes builds the changelog from merged PRs.

All Real-World Interview questions Roadmap: Interview readiness

More on Write-a-pipeline tasks