Skip to content

Commit

Permalink
ci: simplify user email retrieval in GitHub Pages deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
raffaele-oplabs committed Jan 2, 2025
1 parent f96b7ae commit 0a1cbac
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,15 @@ jobs:
- run:
name: Deploy to GitHub Pages
command: |
echo ${GITHUB_APP_TOKEN} > /tmp/GITHUB_APP_TOKEN
pages_branch="gh-pages-test"
SOURCE_COMMIT=$(git rev-parse HEAD)
SOURCE_REPO="${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}"
USERNAME=${CIRCLE_USERNAME}
USER_INFO=$(curl -H "Authorization: token ${GITHUB_APP_TOKEN}" https://api.github.com/users/$USERNAME)
# Extract the email from the user info
ID=$(echo $USER_INFO | jq -r '.id')
# Extract the email from the user info
ID=$(curl https://api.github.com/users/$USERNAME | jq -r '.id')
USER_EMAIL="${ID}+${USERNAME}@users.noreply.github.com"
# Git operations with committer's identity
Expand Down

0 comments on commit 0a1cbac

Please sign in to comment.