Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions .github/workflows/vscode-publish-extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,16 @@ on:
required: false
default: '22.x'
type: string
git-user-name:
description: 'Git user name for version bump commits'
required: false
default: 'GitHub Action'
type: string
git-user-email:
description: 'Git user email for version bump commits'
required: false
default: 'action@github.com'
type: string

# Add explicit permissions for security
permissions:
Expand Down Expand Up @@ -463,9 +473,25 @@ jobs:
else
echo "🔄 Committing version bumps..."

# Configure git for the action
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
# Validate git identity inputs (prevent empty strings from overriding defaults)
GIT_USER_NAME="${{ inputs.git-user-name }}"
GIT_USER_EMAIL="${{ inputs.git-user-email }}"

if [ -z "$GIT_USER_NAME" ]; then
echo "⚠️ git-user-name is empty, using default: GitHub Action"
GIT_USER_NAME="GitHub Action"
fi

if [ -z "$GIT_USER_EMAIL" ]; then
echo "⚠️ git-user-email is empty, using default: action@github.com"
GIT_USER_EMAIL="action@github.com"
fi

# Configure git for the action (using -c flag for safer parameter passing)
export GIT_AUTHOR_NAME="$GIT_USER_NAME"
export GIT_AUTHOR_EMAIL="$GIT_USER_EMAIL"
export GIT_COMMITTER_NAME="$GIT_USER_NAME"
export GIT_COMMITTER_EMAIL="$GIT_USER_EMAIL"

# Configure git to use the PAT for authentication
git remote set-url origin https://x-access-token:${{ secrets.IDEE_GH_TOKEN }}@github.com/${{ github.repository }}.git
Expand Down