Skip to content

Commit

Permalink
chore: fixed github action cleanup branches
Browse files Browse the repository at this point in the history
- authentication with CLI failed

> The value of the GITHUB_TOKEN environment variable is being used for authentication.
> To have GitHub CLI store credentials instead, first clear the value from the environment.
  • Loading branch information
kirrg001 committed Jan 16, 2025
1 parent 7ca0d9b commit 5079a0c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/cleanup-branches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,8 @@ jobs:
git config user.email [email protected]
- name: Authenticate GitHub CLI
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
run: |
echo "${GITHUB_TOKEN}" | gh auth login --with-token
- name: Fetch all branches
run: git fetch --prune --all
gh auth login --with-token <<< "${{ secrets.GH_PAT }}"
- name: Delete old merged branches
env:
Expand All @@ -50,6 +45,8 @@ jobs:
THRESHOLD_DATE=$(date +%s -d '60 days ago')
fi
git fetch --prune --all
for branch in $(git branch -r | grep -E 'origin/(chore-|docs-|fix-|feat-|test-|refactor-)'); do
branch_name=$(echo "$branch" | sed 's|origin/||')
Expand Down

0 comments on commit 5079a0c

Please sign in to comment.