Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
4b5396760This file is pinned to the selected release. Download the original to open it in your design tool.
name: Comment-activated Metrics Comparison
on:
issue_comment:
types: [created]
jobs:
pr_commented:
name: Metrics Comparison
if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '!metrics')}}
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v7
- name: Perform Metrics Comparison
run: |
make venv
./venv/bin/python3 -m pip install --upgrade githubkit
args=()
if [ "$METRICS_REPO" != "" ]; then
args+=( "--metrics-cache-repo" "$METRICS_REPO" )
fi
./venv/bin/python3 .github/scripts/compare_pr_metrics.py "$NUMBER" \
"${args[@]}" \
--repo "$GH_REPO" \
--github-token "$GH_TOKEN" > metrics_comparison_result.md
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
METRICS_REPO: ${{ vars.METRICS_REPO }}
- name: Add comment
run: gh pr comment "$NUMBER" --body-file metrics_comparison_result.md
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}