Add Release Note (bug): On Windows/ARM64, running the 64-bit version of Git for Windows could infrequently cause deadlocked threads (see e.g. [this report](https://github.com/msys2/msys2-autobuild/issues/62) or [this one](https://inbox.sourceware.org/cygwin-developers/78f294de-4c94-242a-722e-fd98e51edff9@jdrake.com/)), [which was addressed](https://github.com/git-for-windows/msys2-runtime/pull/73). #153
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Add Release Note | |
run-name: 'Add Release Note (${{ inputs.type }}): ${{ inputs.message }}' | |
on: | |
workflow_dispatch: | |
inputs: | |
type: | |
description: The type of release note (must be blurb, feature or bug) | |
required: true | |
type: string | |
message: | |
description: The release note | |
required: true | |
type: string | |
jobs: | |
add-release-note: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Configure Git author | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const username = '${{ github.triggering_actor }}' | |
const fallBackEmail = `${username.replace('[bot]', '-bot')}@users.noreply.github.com` | |
const { data: { name, email } } = await github.rest.users.getByUsername({ username }) | |
core.exportVariable('GIT_AUTHOR_NAME', name || username) | |
core.exportVariable('GIT_AUTHOR_EMAIL', email || fallBackEmail) | |
core.exportVariable('GIT_COMMITTER_NAME', name || username) | |
core.exportVariable('GIT_COMMITTER_EMAIL', email || fallBackEmail) | |
- name: Partial & sparse clone | |
run: | | |
git clone --depth=1 --filter=blob:none --no-checkout --single-branch \ | |
-b ${{ github.ref_name }} https://github.com/${{ github.repository }} . && | |
# need only `add-release-notes.js` and `ReleaseNotes.md`, really | |
git sparse-checkout set . && | |
git checkout | |
- name: Add release note | |
env: | |
TYPE: ${{ github.event.inputs.type }} | |
MESSAGE: ${{ github.event.inputs.message }} | |
run: node ./add-release-note.js --commit "$TYPE" "$MESSAGE" | |
- name: Push updates | |
run: | | |
git -c http.extraHeader="Authorization: Basic $(printf 'x-access-token:${{ secrets.GITHUB_TOKEN }}' | base64 -w 0)" push origin HEAD |