Skip to content

Commit

Permalink
prepare for a specific bot account (secrets.SYNC_LABELS_BOT_TOKEN)
Browse files Browse the repository at this point in the history
  • Loading branch information
soehms committed Oct 4, 2023
1 parent d121164 commit 478c8f8
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/sync_labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,23 @@ jobs:
with:
files: .github/sync_labels.py

# Set special sync_labels bot token
- name: Get Tocken
run: |
TOKEN="${{ secrets.SYNC_LABELS_BOT_TOKEN }}"
if [ -z "$TOKEN" ]; then
TOKEN="${{ secrets.GITHUB_TOKEN }}"
fi
echo "TOKEN=$TOKEN" >> $GITHUB_ENV
# Perform synchronization
- name: Call script for synchronization
if: github.event.schedule == ''
run: |
chmod a+x .github/sync_labels.py
.github/sync_labels.py $ACTION $ISSUE_URL $PR_URL $ACTOR "$LABEL" "$REV_STATE" $LOG_LEVEL
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ env.TOKEN }}
ACTION: ${{ github.event.action }}
ISSUE_URL: ${{ github.event.issue.html_url }}
PR_URL: ${{ github.event.pull_request.html_url }}
Expand All @@ -52,6 +61,6 @@ jobs:
chmod a+x .github/sync_labels.py
.github/sync_labels.py $REPO_URL $LOG_LEVEL
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ env.TOKEN }}
REPO_URL: ${{ github.event.repository.html_url }}
LOG_LEVEL: ${{ vars.SYNC_LABELS_LOG_LEVEL }} # variable from repository settings, values can be "--debug", "--info" or "--warning"

0 comments on commit 478c8f8

Please sign in to comment.