mirror of
https://github.com/DRYTRIX/TimeTracker.git
synced 2026-01-05 11:09:55 -06:00
fix: resolve GitHub Actions permissions for PR comments
Fixes: - Add explicit permissions for issues and pull-requests write access - Add github-token parameter to github-script action - Add missing job outputs for migration_changes This resolves the 'Resource not accessible by integration' error when the migration validation workflow tries to comment on pull requests. The workflow now has proper permissions to: - Create and update comments on issues - Write to pull request discussions - Access the GitHub API with appropriate scope
This commit is contained in:
6
.github/workflows/migration-check.yml
vendored
6
.github/workflows/migration-check.yml
vendored
@@ -15,6 +15,8 @@ on:
|
||||
jobs:
|
||||
validate-migrations:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
migration_changes: ${{ steps.migration_check.outputs.migration_changes }}
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
@@ -220,10 +222,14 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
needs: validate-migrations
|
||||
if: github.event_name == 'pull_request' && always()
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Comment migration status on PR
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const success = '${{ needs.validate-migrations.result }}' === 'success';
|
||||
const migrationChanges = '${{ needs.validate-migrations.outputs.migration_changes }}' === 'true';
|
||||
|
||||
Reference in New Issue
Block a user