Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 24, 2025

When forking a repo via common.sh, we typically just want to contribute upstream—not run CI on our fork. This automatically disables Actions after forking.

  • After successful gh repo fork, extract fork path from the new remote URL
  • Call GitHub API to disable Actions: PUT repos/{owner}/{repo}/actions/permissions with enabled=false
  • Warn but continue if the API call fails
if GH_TOKEN="$GITHUB_TOKEN" gh repo fork --remote --remote-name "$ghremote"; then
    fork_repo=$(git remote get-url "$ghremote" | sed -e 's|.*github.com[:/]||' -e 's|\.git$||')
    GH_TOKEN="$GITHUB_TOKEN" gh api -X PUT "repos/$fork_repo/actions/permissions" -F enabled=false || \
        echo "WARNING: Failed to disable actions on fork $fork_repo" >&2

Handles both SSH and HTTPS remote URLs.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>disable actions in my forks my default</issue_title>
<issue_description>when we fork a repo on github, actions in the fork should be disabled by default -- we just to provide upstream and not monitor </issue_description>

<agent_instructions>review codebase and right after forking disable actions on the fork... likely with gh command if possible</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Disable actions in forks by default Disable GitHub Actions on forks by default Nov 24, 2025
Copilot AI requested a review from yarikoptic November 24, 2025 22:01
@yarikoptic yarikoptic marked this pull request as ready for review November 24, 2025 22:13
@yarikoptic yarikoptic merged commit dd89dc6 into main Nov 24, 2025
4 checks passed
@yarikoptic yarikoptic deleted the copilot/disable-actions-in-forks branch November 24, 2025 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

disable actions in my forks my default

2 participants