Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tstellar committed Feb 23, 2024
1 parent bc1205a commit 26151b0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/user-branch-rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ jobs:
steps:
- name: Check branch length
env:
GITHUB_TOKEN: ${{ github.token }}
MAX_BRANCH_LENGTH: 64

run: |
if [ `echo "${{ github.ref }}" | wc -c` -gt "$MAX_BRANCH_LENGTH" ]; then
if [ `echo "$GITHUB_REF" | wc -c` -gt "$MAX_BRANCH_LENGTH" ]; then
curl -s -X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ github.token }}" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/git/${{ github.ref }}
echo "Branch %{{ github.ref }} deleted"
"https://api.github.com/repos/$GITHUB_REPOSITORY/git/$GITHUB_REF"
echo "Branch $GITHUB_REF deleted"
fi

0 comments on commit 26151b0

Please sign in to comment.