yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Ellie Hermaszewskainstall mono for toc generation (#5877)0a6ffee0c

master
4.0 KiB87 linesraw
1name: Regenerate TOC
2on:
3  repository_dispatch:
4    types: [regenerate-toc-command]
5jobs:
6  regenerate-toc:
7    runs-on: ubuntu-latest
8    steps:
9      - name: Checkout PR branch
10        uses: actions/checkout@v4
11        with:
12          token: ${{ secrets.SLANGBOT_PAT }}
13          repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
14          ref: ${{ github.event.client_payload.pull_request.head.ref }}
15          path: pr-branch
16
17      - name: Checkout target branch
18        uses: actions/checkout@v4
19        with:
20          token: ${{ secrets.SLANGBOT_PAT }}
21          repository: ${{ github.event.client_payload.pull_request.base.repo.full_name }}
22          ref: ${{ github.event.client_payload.pull_request.base.ref }}
23          path: target-branch
24
25      - name: Install Mono
26        run: |
27          sudo apt-get update
28          sudo apt-get install -y mono-complete
29
30      - name: Regenerate Table of Contents
31        id: regen
32        run: |
33          ./target-branch/docs/build_toc.sh --source ./pr-branch
34
35      - name: Configure Git commit signing
36        id: git-info
37        run: |
38          echo "${{ secrets.SLANGBOT_SIGNING_KEY }}" > "${{runner.temp}}"/signing_key
39          chmod 600 "${{runner.temp}}"/signing_key
40          git -C pr-branch config commit.gpgsign true
41          git -C pr-branch config gpg.format ssh
42          git -C pr-branch config user.signingkey "${{runner.temp}}"/signing_key
43          bot_info=$(curl -s -H "Authorization: Bearer ${{ secrets.SLANGBOT_PAT }}" \
44            "https://api.github.com/user")
45          echo "bot_identity=$(echo $bot_info | jq --raw-output '.login + " <" + (.id|tostring) + "+" + .login + "@users.noreply.github.com>"')" >> $GITHUB_OUTPUT
46          echo "bot_name=$(echo $bot_info | jq --raw-output '.login')" >> $GITHUB_OUTPUT
47
48      - name: Create Pull Request
49        id: create-pr
50        uses: peter-evans/create-pull-request@v7
51        with:
52          token: ${{ secrets.SLANGBOT_PAT }}
53          path: pr-branch
54          commit-message: "regenerate documentation Table of Contents"
55          title: "Regenerate documentation ToC for PR #${{ github.event.client_payload.pull_request.number }}"
56          body: "Automated ToC generation for ${{ github.event.client_payload.pull_request.html_url }}"
57          committer: ${{ steps.git-info.outputs.bot_identity }}
58          author: ${{ steps.git-info.outputs.bot_identity }}
59          branch: regenerate-toc-${{ github.event.client_payload.pull_request.number }}-${{ github.event.client_payload.pull_request.head.ref }}
60          base: ${{ github.event.client_payload.pull_request.head.ref }}
61          push-to-fork: ${{ steps.git-info.outputs.bot_name }}/slang
62          delete-branch: true
63
64      - name: Comment on PR
65        uses: peter-evans/create-or-update-comment@v4
66        if: always()
67        with:
68          token: ${{ secrets.SLANGBOT_PAT }}
69          repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
70          issue-number: ${{ github.event.client_payload.pull_request.number }}
71          body: |
72            ${{ 
73              steps.regen.conclusion == 'failure'
74              && format('❌ Table of Contents generation failed. Please check the [workflow run](https://github.com/{0}/actions/runs/{1})', github.repository, github.run_id)
75              || (steps.create-pr.conclusion == 'failure' 
76                  && format('❌ Failed to create regenerate ToC pull request. Please check the [workflow run](https://github.com/{0}/actions/runs/{1})', github.repository, github.run_id)
77                  || format('🌈 Regenerated Table of Contents, please merge the changes from [this PR]({0})', steps.create-pr.outputs.pull-request-url))
78            }}
79
80      - name: Add reaction
81        uses: peter-evans/create-or-update-comment@v4
82        with:
83          token: ${{ secrets.SLANGBOT_PAT }}
84          repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
85          comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
86          reactions-edit-mode: replace
87          reactions: hooray