File: backtrace-commit-fix.yml

package info (click to toggle)
openrct2 0.4.31%2Bds-1
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid
  • size: 105,012 kB
  • sloc: cpp: 677,649; ansic: 1,322; javascript: 716; xml: 646; sh: 439; python: 313; php: 34; makefile: 19
file content (26 lines) | stat: -rw-r--r-- 830 bytes parent folder | download | duplicates (5)
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
name: 'Backtrace issue commit correction'
on:
  issues:
    types:
      - opened
jobs:
  backtrace_commit_correction:
    runs-on: ubuntu-latest
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      ISSUE: ${{ github.event.issue.html_url }}
    if: |
      contains(github.event.issue.labels.*.name, 'backtrace.io')
    steps:
      - name: Modify issue contents
        env:
          BODY: ${{ github.event.issue.body }}
        id: fix
        run: |
          changed_body=$(echo "$BODY" | sed '/<strong>commit<\/strong>/,/<\/ul>/ s/<code>\([0-9a-f]\{7,\}\)<\/code>/\1/g')
          if [[ "$changed_body" == "$BODY" ]]; then
            echo "Unable to match the Backtrace report format."
            exit 1
          fi
          echo "$changed_body" >> body.txt
          gh issue edit $ISSUE --body-file body.txt