Skip to content

Commit

Permalink
fix: setting GITHUN_TOKEN by the env variable (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
geekbrother authored Oct 9, 2024
1 parent 08fce90 commit 43b0c94
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions github/update-rust-version/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ inputs:
token:
description: 'A Github PAT with write access to the repository'
required: true
bot-name:
default: 'github-actions[bot]'
required: false
bot-email:
default: 'github-actions[bot]@users.noreply.github.com'
required: false

outputs:
version:
Expand All @@ -22,8 +28,8 @@ runs:
check: true
check-latest-tag-only: true
release: true
git-user: 'github-actions[bot]'
git-user-email: "github-actions[bot]@users.noreply.github.com"
git-user: ${{ inputs.bot-name }}
git-user-email: ${{ inputs.bot-email }}

- name: Update version in Cargo.toml and Cargo.lock
shell: bash
Expand All @@ -34,18 +40,21 @@ runs:
sed -e "/^name = \"$package_name\"\$/{ n; s/^version = \".*\"\$/version = \"$version\"/g; }" ./Cargo.lock > /tmp/cargo.lock
mv /tmp/cargo.toml ./Cargo.toml
mv /tmp/cargo.lock ./Cargo.lock
- name: Set GITHUB_TOKEN for Commit
run: echo "GITHUB_TOKEN=${{ inputs.token }}" >> $GITHUB_ENV
- name: Set up git authentication
shell: bash
run: |
git config --global user.name "${{ inputs.bot-name }}"
git config --global user.email "${{ inputs.bot-email }}"
git remote set-url origin https://x-access-token:${{ inputs.token }}@github.com/${{ github.repository }}
- name: Commit version bump
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: Bump version for release"
file_pattern: "Cargo.toml Cargo.lock"
commit_user_name: "github-actions[bot]"
commit_user_email: "github-actions[bot]@users.noreply.github.com"
commit_user_name: ${{ inputs.bot-name }}
commit_user_email: ${{ inputs.bot-email }}

- name: Install Rust
uses: WalletConnect/actions-rs/[email protected]
Expand Down

0 comments on commit 43b0c94

Please sign in to comment.