fix(ci): match dependabot PR author instead of github.actor #27
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Preview Build | |
| on: | |
| pull_request: | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: taiki-e/install-action@b6ff580856c41316412a0b9b60540fbc6f8c82cc # v2.86.7 | |
| with: | |
| tool: just | |
| - name: Build site | |
| id: build | |
| run: just build | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: preview-site-${{ github.event.pull_request.number }} | |
| path: _site | |
| retention-days: 7 | |
| - name: Comment on pull request | |
| if: always() | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| with: | |
| script: | | |
| const fs = require("fs"); | |
| const prNumber = context.issue.number; | |
| const artifactName = `preview-site-${prNumber}`; | |
| const template = fs.readFileSync(".github/comment-templates/preview-build.md", "utf8"); | |
| const comment = template.replace("{{artifactName}}", artifactName); | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: prNumber, | |
| body: comment | |
| }); |