From e9de4e59d27723cd714973158384c433321306e8 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 17 Apr 2026 12:16:01 +0200 Subject: [PATCH 1/2] fixup! workflow: add release-vfsforgit to automate VFS for Git updates The heredoc used to construct PR_BODY fails in GitHub Actions because the YAML `run: |` block preserves its indentation when passing the script to bash. The closing `EOF` delimiter ends up indented with spaces, but bash's `< --- .github/workflows/release-vfsforgit.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-vfsforgit.yml b/.github/workflows/release-vfsforgit.yml index beffb3915b4fb1..88c641cddc7d2d 100644 --- a/.github/workflows/release-vfsforgit.yml +++ b/.github/workflows/release-vfsforgit.yml @@ -80,11 +80,8 @@ jobs: WORKFLOW_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" RELEASE_URL="https://github.com/microsoft/git/releases/tag/$TAG" PR_TITLE="Update default Microsoft Git version to $TAG" - PR_BODY=$(cat < Date: Fri, 17 Apr 2026 12:25:58 +0200 Subject: [PATCH 2/2] fixup! workflow: add release-vfsforgit to automate VFS for Git updates Add a workflow_dispatch trigger so the workflow can be re-run manually when the release-triggered run fails (as happened in https://github.com/microsoft/git/actions/runs/24558034660/job/71799344023). Without this, the only way to retry is to create a new release. This follows the same pattern as the winget workflow, which already has a workflow_dispatch trigger with a `tag` input. The tag is resolved once in a top-level `env:` block via `${{ github.event.inputs.tag || github.event.release.tag_name }}` so both trigger paths feed the same `TAG_NAME` environment variable. The old `Compute tag name` step and the local `TAG` shell variable are no longer needed. Assisted-by: Claude Opus 4.6 Signed-off-by: Johannes Schindelin --- .github/workflows/release-vfsforgit.yml | 28 ++++++++++++++----------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release-vfsforgit.yml b/.github/workflows/release-vfsforgit.yml index 88c641cddc7d2d..aab076e85c6695 100644 --- a/.github/workflows/release-vfsforgit.yml +++ b/.github/workflows/release-vfsforgit.yml @@ -4,18 +4,23 @@ on: release: types: [released] + workflow_dispatch: + inputs: + tag: + description: 'Tag name to release' + required: true + permissions: id-token: write # required for Azure login via OIDC +env: + TAG_NAME: ${{ github.event.inputs.tag || github.event.release.tag_name }} + jobs: update: runs-on: ubuntu-latest environment: release steps: - - name: Compute tag name - id: tag - run: echo "name=${{ github.event.release.tag_name }}" >>$GITHUB_OUTPUT - - name: Log into Azure uses: azure/login@v2 with: @@ -48,9 +53,8 @@ jobs: gh auth setup-git gh config set git_protocol https - TAG="${{ steps.tag.outputs.name }}" REPO="microsoft/VFSForGit" - BRANCH="automation/gitrelease-$TAG" + BRANCH="automation/gitrelease-$TAG_NAME" FILE=".github/workflows/build.yaml" # Clone VFS for Git repo (sparse partial clone for efficiency) @@ -63,7 +67,7 @@ jobs: git checkout -b "$BRANCH" # Update the GIT_VERSION default in build.yaml - sed -i "/GIT_VERSION/s/|| '[^']*' }}/|| '$TAG' }}/" "$FILE" + sed -i "/GIT_VERSION/s/|| '[^']*' }}/|| '$TAG_NAME' }}/" "$FILE" # Verify the change was made if ! git diff --quiet "$FILE"; then @@ -71,17 +75,17 @@ jobs: git config user.email "github-actions[bot]@users.noreply.github.com" git add "$FILE" - git commit -m "Update default Microsoft Git version to $TAG" + git commit -m "Update default Microsoft Git version to $TAG_NAME" # Push the new branch git push origin "$BRANCH" # Create the PR WORKFLOW_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" - RELEASE_URL="https://github.com/microsoft/git/releases/tag/$TAG" - PR_TITLE="Update default Microsoft Git version to $TAG" + RELEASE_URL="https://github.com/microsoft/git/releases/tag/$TAG_NAME" + PR_TITLE="Update default Microsoft Git version to $TAG_NAME" PR_BODY="This PR was automatically created by the [microsoft/git release workflow]($WORKFLOW_URL) - to update the default Microsoft Git version to [\`$TAG\`]($RELEASE_URL)." + to update the default Microsoft Git version to [\`$TAG_NAME\`]($RELEASE_URL)." PR_URL=$(gh pr create \ --repo "$REPO" \ @@ -90,5 +94,5 @@ jobs: --body "$PR_BODY") echo "::notice::Created VFS for Git PR: $PR_URL" else - echo "::warning::No changes detected in $FILE; GIT_VERSION may already be set to $TAG" + echo "::warning::No changes detected in $FILE; GIT_VERSION may already be set to $TAG_NAME" fi