|
41 | 41 |
|
42 | 42 | - name: Compile for wasm32 target |
43 | 43 | run: just check |
| 44 | + |
| 45 | + comment: |
| 46 | + name: Comment on PR |
| 47 | + if: github.event_name == 'pull_request' |
| 48 | + runs-on: ubuntu-latest |
| 49 | + permissions: |
| 50 | + pull-requests: write |
| 51 | + steps: |
| 52 | + - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 |
| 53 | + with: |
| 54 | + script: | |
| 55 | + const marker = '<!-- rust-code-modified -->'; |
| 56 | + const body = [ |
| 57 | + marker, |
| 58 | + '⚠️ **This PR modifies the Rust code.**', |
| 59 | + '', |
| 60 | + 'For these changes to take effect in the TypeScript code, you will need to:', |
| 61 | + '', |
| 62 | + '1. Publish a new version of the `argon2id-wasm` package on npm.', |
| 63 | + '2. Update the dependency on `argon2id-wasm` in the `core` component.', |
| 64 | + ].join('\n'); |
| 65 | +
|
| 66 | + const { data: comments } = await github.rest.issues.listComments({ |
| 67 | + owner: context.repo.owner, |
| 68 | + repo: context.repo.repo, |
| 69 | + issue_number: context.issue.number, |
| 70 | + }); |
| 71 | +
|
| 72 | + const existing = comments.find((c) => c.body.includes(marker)); |
| 73 | +
|
| 74 | + if (existing) { |
| 75 | + await github.rest.issues.updateComment({ |
| 76 | + owner: context.repo.owner, |
| 77 | + repo: context.repo.repo, |
| 78 | + comment_id: existing.id, |
| 79 | + body, |
| 80 | + }); |
| 81 | + } else { |
| 82 | + await github.rest.issues.createComment({ |
| 83 | + owner: context.repo.owner, |
| 84 | + repo: context.repo.repo, |
| 85 | + issue_number: context.issue.number, |
| 86 | + body, |
| 87 | + }); |
| 88 | + } |
0 commit comments