yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
f25e5a89f
master
1name : Comment IR Version Check Results 2 3on : 4workflow_run : 5workflows : [ "CI" ] 6types : 7- completed 8 9jobs : 10comment : 11runs-on : ubuntu-latest 12if : github.event.workflow_run.event == 'pull_request' 13 14steps : 15- name : Download artifacts 16id : download 17uses : actions/github-script@v7 18with : 19script : | 20const artifacts = await github.rest.actions.listWorkflowRunArtifacts({ 21owner: context.repo.owner, 22repo: context.repo.repo, 23run_id: ${{ github.event.workflow_run.id }}, 24}); 25 26const matchArtifact = artifacts.data.artifacts.filter((artifact) => { 27return artifact.name == "ir-version-check-results" 28})[0]; 29 30if (!matchArtifact) { 31console.log('No IR version check artifacts found - nothing to comment'); 32return false; 33} 34 35const download = await github.rest.actions.downloadArtifact({ 36owner: context.repo.owner, 37repo: context.repo.repo, 38artifact_id: matchArtifact.id, 39archive_format: 'zip', 40}); 41 42const fs = require('fs'); 43fs.writeFileSync('${{github.workspace}}/ir-version-check-results.zip', Buffer.from(download.data)); 44return true; 45 46- name : Extract artifacts 47if : steps.download.outputs.result == 'true' 48run : unzip ir-version-check-results.zip 49 50- name : Read PR number 51if : steps.download.outputs.result == 'true' 52id : pr 53run : | 54echo "number=$(cat pr-number.txt)" >> $GITHUB_OUTPUT 55 56- name : Find existing comment 57if : steps.download.outputs.result == 'true' 58id : find-comment 59uses : peter-evans/find-comment@v3 60with : 61token : ${{ secrets.SLANGBOT_PAT }} 62issue-number : ${{ steps.pr.outputs.number }} 63body-includes : "<!-- slang-ir-version-check -->" 64 65- name : Create or update comment 66if : steps.download.outputs.result == 'true' 67uses : peter-evans/create-or-update-comment@v4 68with : 69token : ${{ secrets.SLANGBOT_PAT }} 70issue-number : ${{ steps.pr.outputs.number }} 71comment-id : ${{ steps.find-comment.outputs.comment-id }} 72body-path : comment-body.txt 73edit-mode : replace