Skip to content

Commit

Permalink
fix token usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Yehonal authored Mar 28, 2024
1 parent 14fd9a0 commit 3db2ed7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions better-dependabot/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ runs:
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add --all
git commit -m "Update dependencies"
# Construct the repository URL with the token for authentication
REPO_URL_WITH_TOKEN=$(echo "${{ github.server_url }}/${{ github.repository }}" | sed -e "s|https://|https://x-access-token:${{ inputs.token }}@|")
# Set the remote with the authenticated URL
git remote set-url origin $REPO_URL_WITH_TOKEN
# Now push using the authenticated URL
git push --set-upstream origin $BRANCH_NAME
shell: bash
env:
Expand Down

0 comments on commit 3db2ed7

Please sign in to comment.