Skip to content

chore(ci): skip auto commit if scoped token is not present #635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
REPO_SCOPED_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }}

steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.REPO_SCOPED_TOKEN || github.token }}
token: ${{ env.REPO_SCOPED_TOKEN || github.token }}

- name: Setup environment
uses: ./.github/actions/setup-environment
Expand All @@ -38,8 +38,7 @@ jobs:
shell: bash

- uses: stefanzweifel/git-auto-commit-action@v5
# Always commit changes even if pre-commit failed
if: always() && github.event_name == 'pull_request'
if: ${{ always() && env.REPO_SCOPED_TOKEN && github.event_name == 'pull_request' }}
with:
commit_message: "Automated pre-commit update"
push_options: "--no-verify"
Loading