The Flutter Test workflow fails to post a comment on successful test completion due to a permissions issue with the GitHub Script action. Specifically, it throws the following error:
Error: Unhandled error: HttpError: Resource not accessible by integration
The error occurs in the Check Test Results step, which attempts to create a comment on the pull request once tests pass. This issue may be related to permission settings or token access limitations for the GitHub Script.
Here is the relevant section of the workflow:
- name: Check Test Results
if: success()
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.payload.pull_request.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'All tests passed! 🎉'
})
This error has also occurred in the following pull requests: #114 #120
Thank you!