Skip to content

Commit

Permalink
Merge pull request #231 from block/myron/fix-PAT-push
Browse files Browse the repository at this point in the history
Fix `update-gem-version-artifacts.yaml` to push using the PAT properly.
  • Loading branch information
myronmarston authored Feb 25, 2025
2 parents a056467 + e493892 commit 57c2624
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/update-gem-version-artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ jobs:
- name: Checkout Git Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
# We still need to check out using GITHUB_TOKEN so we can make local changes,
# but the push will use the personal access token.
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
# Use the PAT for checkout to ensure proper permissions
token: ${{ secrets.PAT_FOR_PUSHING_AND_TRIGGERING_CI }}

- name: Set up Ruby
uses: ruby/setup-ruby@2a18b06812b0e15bb916e1df298d3e740422c47e # v1.203.0
Expand All @@ -48,8 +47,7 @@ jobs:
git add rbs_collection.lock.yaml Gemfile Gemfile.lock *.gemspec
git commit -m "Update gem version artifacts."
# Push with PAT so it triggers "on: pull_request" or "on: push" events
# Replace "block" with your actual GitHub org/user, if different.
git push "https://github-actions[bot]:${{ secrets.PAT_FOR_PUSHING_AND_TRIGGERING_CI }}@github.com/block/elasticgraph.git" HEAD:${{ github.head_ref }}
# Push using the PAT
git remote set-url origin "https://x-access-token:${{ secrets.PAT_FOR_PUSHING_AND_TRIGGERING_CI }}@github.com/${{ github.repository }}.git"
git push origin HEAD:${{ github.head_ref }}
fi

0 comments on commit 57c2624

Please sign in to comment.