Skip to content

feat: add SKIP_ARCHIVED option to github-add-repo-permissions - #59

Merged
locus313 merged 1 commit into
mainfrom
feature/skip-archived-repo-permissions
Aug 21, 2026
Merged

feat: add SKIP_ARCHIVED option to github-add-repo-permissions#59
locus313 merged 1 commit into
mainfrom
feature/skip-archived-repo-permissions

Conversation

@locus313

Copy link
Copy Markdown
Owner

Description

Adds an option to skip granting maintain/push/triage/pull permissions on archived repositories, while still applying admin permissions so owning teams retain settings access after archival.

Changes

  • New script: <domain>/github-<name>/github-<name>.sh
  • Modified: org-admin/github-add-repo-permissions/github-add-repo-permissions.sh, org-admin/github-add-repo-permissions/action.yml, README.md, tests/test_script_validation.bats
  • Other:

How to test

export GITHUB_TOKEN=ghp_REDACTED
export ORG=test-org
export REPO_ADMIN="platform-team"
export REPO_PULL="external-auditors"
export SKIP_ARCHIVED=true
./org-admin/github-add-repo-permissions/github-add-repo-permissions.sh

Expected: archived repos still receive admin permissions, but maintain/push/triage/pull are skipped and logged as "Skipping non-admin permissions on (archived)". Non-archived repos are unaffected.

Checklist

  • set -euo pipefail is the first executable line after the # === header
  • Script sources lib/github-common.sh via SCRIPT_DIR
  • All required env vars validated with require_env_var
  • Token validated with validate_github_token (or validate_token for secondary tokens)
  • User-supplied slugs validated with validate_slug
  • sleep added between repo-level operations to respect rate limits
  • README.md updated with the new/changed script (env var table + usage example)
  • Script header comment matches README documentation
  • Tested on a non-production org before production
  • shellcheck passes (shellcheck --severity=warning --exclude=SC2034,SC1091 --shell=bash <script>)

Skips granting maintain/push/triage/pull permissions on archived repos
when SKIP_ARCHIVED=true. Admin permissions are still applied on
archived repos so owning teams retain settings access after archival.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@locus313
locus313 merged commit 4e45402 into main Aug 21, 2026
2 checks passed
@locus313
locus313 deleted the feature/skip-archived-repo-permissions branch August 21, 2026 17:16
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.

1 participant