Skip to content

Commit

Permalink
chore: try exporting the github token so... (#2019)
Browse files Browse the repository at this point in the history
chore: try exporting the github token so it's available for git push

Signed-off-by: Nick Boldt <[email protected]>
  • Loading branch information
nickboldt authored Aug 7, 2024
1 parent de05a97 commit 84ada10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/actions/yarn-lock/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@ runs:
echo
echo "$changed_files"
echo
set -x
git config --global user.name "RHDH Bot"
git config --global user.email [email protected]
git config --global pull.rebase true
git config --global push.default matching
# workaround for "fatal: could not read Username for 'https://github.com'"
git config remote.origin.url "https://${GITHUB_TOKEN}:[email protected]/janus-idp/backstage-plugins.git"
git stash || true
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
Expand All @@ -30,6 +27,9 @@ runs:
git stash pop || true
git add yarn.lock || true
git commit -s -m "chore(deps): regen yarn.lock" yarn.lock || true
export GITHUB_TOKEN="${GITHUB_TOKEN}"
set -x
echo "$(git config user.name) <$(git config user.email)>"; echo; gh auth status
git push origin "${PR_BRANCH}"
gh pr create -B "${CURRENT_BRANCH}" -H "${PR_BRANCH}" --title "chore(deps): regen yarn.lock" --body "Created by Github action due to dirty workspace."
fi
7 changes: 0 additions & 7 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ jobs:
app-id: ${{ vars.JANUS_IDP_GITHUB_APP_ID }}
private-key: ${{ secrets.JANUS_IDP_GITHUB_APP_PRIVATE_KEY }}

# - name: Setup git credentials
# run: |
# git config --global url.https://rhdh-bot:${{ steps.generate-token.outputs.token }}@github.com/.insteadOf https://github.com/
# # Fix for Could not read Username / No such device or address :: https://github.com/github/hub/issues/1644
# # git config --global hub.protocol https
# # git remote set-url origin 'https://\$GITHUB_TOKEN:x-oauth-basic@'

- name: Regen yarn.lock
uses: ./.github/actions/yarn-lock
env:
Expand Down

0 comments on commit 84ada10

Please sign in to comment.