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