Files
actual/.github/workflows/release-notes.yml
T
Matt FiddamanandGitHub ecfe43fdda split release into two branches (#7844)
* split release into two branches

* update docs to match the new process

* note

* zizmor comment

* Update check-spelling metadata

* use single long lived release branch

* coderabbit

* jfdoming suggestions
2026-05-19 12:47:08 +00:00

98 lines
3.4 KiB
YAML

name: Release notes
on:
pull_request:
push:
branches:
- release
permissions:
contents: write
pull-requests: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check-release-notes:
if: >-
github.event_name == 'pull_request'
&& github.head_ref != 'release'
&& startsWith(github.head_ref, 'release-notes/') == false
runs-on: ubuntu-latest
environment: pr-automation
steps:
- name: Check if triggered by bot
id: bot-check
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const { data: commit } = await github.rest.git.getCommit({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: context.payload.pull_request.head.sha,
});
const skip = commit.author.name === 'github-actions[bot]'
&& commit.message.startsWith('Generate release notes');
console.log(`Head commit by "${commit.author.name}": ${commit.message.split('\n')[0]}`);
console.log(`Skip: ${skip}`);
core.setOutput('skip', String(skip));
- name: Checkout
if: steps.bot-check.outputs.skip != 'true'
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Get changed files
if: steps.bot-check.outputs.skip != 'true'
id: changed-files
run: |
git fetch origin ${GITHUB_BASE_REF}
CHANGED_FILES=$(git diff --name-only origin/${GITHUB_BASE_REF}...HEAD)
NON_DOCS_FILES=$(echo "$CHANGED_FILES" | grep -v -e "^packages/docs/" -e "^\.github/actions/docs-spelling/" || true)
if [ -z "$NON_DOCS_FILES" ] && [ -n "$CHANGED_FILES" ]; then
echo "only_docs=true" >> $GITHUB_OUTPUT
echo "only documentation files changed, skipping release notes check"
else
echo "only_docs=false" >> $GITHUB_OUTPUT
fi
- name: Check release notes
if: >-
steps.bot-check.outputs.skip != 'true'
&& steps.changed-files.outputs.only_docs != 'true'
uses: ./.github/actions/release-notes/check
generate-release-notes:
if: github.event_name == 'push'
runs-on: ubuntu-latest
environment: release
steps:
- name: Resolve version
id: version
env:
GH_TOKEN: ${{ secrets.ACTIONS_UPDATE_TOKEN || github.token }}
run: |
version=$(gh api "repos/${GITHUB_REPOSITORY}/contents/packages/desktop-client/package.json?ref=release" --jq '.content' | base64 -d | jq -r .version)
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "notes_branch=release-notes/$version" >> "$GITHUB_OUTPUT"
- name: Checkout release-notes branch
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ steps.version.outputs.notes_branch }}
fetch-depth: 0
token: ${{ secrets.ACTIONS_UPDATE_TOKEN || github.token }}
persist-credentials: true
- name: Generate release notes
uses: ./.github/actions/release-notes/generate
with:
release-branch: release
notes-branch: ${{ steps.version.outputs.notes_branch }}
version: ${{ steps.version.outputs.version }}