[PR #1153] [MERGED] fix(ci): auto-label permissions for fork PRs #1144

Closed
opened 2026-03-22 16:01:56 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/harvard-edge/cs249r_book/pull/1153
Author: @profvjreddi
Created: 2/4/2026
Status: Merged
Merged: 2/4/2026
Merged by: @profvjreddi

Base: devHead: fix/auto-label-permissions


📝 Commits (1)

  • 83a3ce3 fix(ci): use pull_request_target for auto-label write permissions

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 .github/workflows/auto-label.yml (+1 -1)

📄 Description

Summary

  • Switch pull_requestpull_request_target in auto-label workflow
  • Fixes 403 "Resource not accessible by integration" when labeling fork PRs (failed run)

Root cause

GitHub downgrades GITHUB_TOKEN to read-only for pull_request events from forks. pull_request_target runs in the base repo context, granting the declared issues: write and pull-requests: write permissions.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/harvard-edge/cs249r_book/pull/1153 **Author:** [@profvjreddi](https://github.com/profvjreddi) **Created:** 2/4/2026 **Status:** ✅ Merged **Merged:** 2/4/2026 **Merged by:** [@profvjreddi](https://github.com/profvjreddi) **Base:** `dev` ← **Head:** `fix/auto-label-permissions` --- ### 📝 Commits (1) - [`83a3ce3`](https://github.com/harvard-edge/cs249r_book/commit/83a3ce3712c9985605ecf1cbe48b0514dc843a6c) fix(ci): use pull_request_target for auto-label write permissions ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/auto-label.yml` (+1 -1) </details> ### 📄 Description ## Summary - Switch `pull_request` → `pull_request_target` in auto-label workflow - Fixes 403 "Resource not accessible by integration" when labeling fork PRs ([failed run](https://github.com/harvard-edge/cs249r_book/actions/runs/21643621058)) ## Root cause GitHub downgrades `GITHUB_TOKEN` to read-only for `pull_request` events from forks. `pull_request_target` runs in the base repo context, granting the declared `issues: write` and `pull-requests: write` permissions. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-22 16:01:56 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#1144