File: diff_shades_comment.yml

package info (click to toggle)
black 25.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,180 kB
  • sloc: python: 113,389; makefile: 25
file content (49 lines) | stat: -rw-r--r-- 1,537 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: diff-shades-comment

on:
  workflow_run:
    workflows: [diff-shades]
    types: [completed]

permissions:
  pull-requests: write

jobs:
  comment:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-python@v6
        with:
          python-version: "3.13"

      - name: Install support dependencies
        run: |
          python -m pip install pip --upgrade
          python -m pip install click packaging urllib3

      - name: Get details from initial workflow run
        id: metadata
        env:
          GITHUB_TOKEN: ${{ github.token }}
        run: >
          python scripts/diff_shades_gha_helper.py comment-details
          ${{github.event.workflow_run.id }}

      - name: Try to find pre-existing PR comment
        if: steps.metadata.outputs.needs-comment == 'true'
        id: find-comment
        uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad
        with:
          issue-number: ${{ steps.metadata.outputs.pr-number }}
          comment-author: "github-actions[bot]"
          body-includes: "diff-shades"

      - name: Create or update PR comment
        if: steps.metadata.outputs.needs-comment == 'true'
        uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9
        with:
          comment-id: ${{ steps.find-comment.outputs.comment-id }}
          issue-number: ${{ steps.metadata.outputs.pr-number }}
          body: ${{ steps.metadata.outputs.comment-body }}
          edit-mode: replace