Skip to content

getting rid of the string interpolation format #21

getting rid of the string interpolation format

getting rid of the string interpolation format #21

Workflow file for this run

name: label-issues
on:
workflow_dispatch:
push:
branches:
- relabeling
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
jobs:
label-issues:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set-up labels and label filter
id: set-up
run: |
LABELS=$(jq -r '.labels' ./labels.json)
echo "labels<<EOF" >> $GITHUB_ENV
echo "$LABELS" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo "filter=$(jq -r '.filter' ./labels.json)" >> $GITHUB_ENV
- name: Collect all issues
run: |
gh issue list --state all --label "plugin-modification" --json number,labels,body > issues.json
- name: Find unlabeled issues
run: |
echo "$labels"
echo "$filter"
jq --argjson labels "$labels" "$filter" issues.json > unlabeled_issues.json
- name: Install Copilot CLI
run: |
curl -fsSL https://gh.io/copilot-install | bash
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Generate labels for issue
run: |
jq -r -c '.[] | .number, .body' ./unlabeled_issues.json | while read -r number && read -r body; do
echo "Generating labels for: Issue No. $number"
LABELS=$(copilot --prompt "Pick labels from $labels for issue $number based on the content of $body" \
--model gpt-4.1 \
--allow-tool "read_file")
echo "Labels generated: $LABELS"
done