Skip to content

Scheduling infrastructure for absolutely everyone.

fix: use triggering user's email/name in draft-release workflow (#22229)

Omar López02967961f390
diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml
index 09520a0676a..40ab791c4ef 100644
--- a/.github/workflows/draft-release.yml
+++ b/.github/workflows/draft-release.yml
@@ -27,8 +27,24 @@ jobs:
- name: Configure git
run: |
- git config --local user.email "[email protected]"
- git config --local user.name "GitHub Actions"
+ # Define authorized users and their emails using organization secret
+ # Expected format: JSON object with username -> email mapping
+ # Example: {"zomars": "[email protected]", "peer": "[email protected]", "username3": "[email protected]"}
+ USER_EMAILS='${{ secrets.RELEASE_USER_EMAILS }}'
+
+ # Extract email for the triggering user
+ USER_EMAIL=$(echo "$USER_EMAILS" | jq -r --arg user "${{ github.actor }}" '.[$user] // empty')
+
+ # Fail if user is not authorized or not in mapping
+ if [ -z "$USER_EMAIL" ] || [ "$USER_EMAIL" = "null" ]; then
+ echo "Error: User '${{ github.actor }}' is not authorized to run the release workflow."
+ echo "Only authorized team members can trigger releases."
+ echo "Contact your administrator to be added to the authorized users list."
+ exit 1
+ fi
+
+ git config --local user.email "$USER_EMAIL"
+ git config --local user.name "${{ github.actor }}"
- uses: ./.github/actions/yarn-install