Skip to content

Commit 36717f9

Browse files
locus313Copilot
andcommitted
feat: make github-token optional in all action.yml files
- Change github-token from required to optional in all 16 existing action.yml files; env mapping uses inputs.github-token || github.token so the built-in Actions token is used automatically when no PAT is provided - Add new action.yml for github-repo-permissions-report - Add new action.yml for github-copilot-report (with no-entra, credits, enterprise, and upn-domain inputs) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 76a26b2 commit 36717f9

17 files changed

Lines changed: 99 additions & 30 deletions

File tree

enterprise/github-add-enterprise-team-read-permissions/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: 'Grant read permissions to an enterprise team across all organizati
33
inputs:
44
github-token:
55
description: 'PAT with admin:enterprise scope'
6-
required: true
6+
required: false
77
enterprise:
88
description: 'GitHub Enterprise slug'
99
required: true
@@ -24,7 +24,7 @@ runs:
2424
- name: Add enterprise team read permissions
2525
shell: bash
2626
env:
27-
GITHUB_TOKEN: ${{ inputs.github-token }}
27+
GITHUB_TOKEN: ${{ inputs.github-token || github.token }}
2828
ENTERPRISE: ${{ inputs.enterprise }}
2929
ENTERPRISE_TEAM_SLUG: ${{ inputs.enterprise-team-slug }}
3030
ALL_REPO_READ_ROLE_NAME: ${{ inputs.all-repo-read-role-name }}

enterprise/github-dockerfile-discovery/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: 'Discover Dockerfiles and extract FROM instructions across all ente
33
inputs:
44
github-token:
55
description: 'PAT with read:org and repo scope'
6-
required: true
6+
required: false
77
enterprise:
88
description: 'GitHub Enterprise slug'
99
required: true
@@ -41,7 +41,7 @@ runs:
4141
- name: Discover Dockerfiles across enterprise
4242
shell: bash
4343
env:
44-
GITHUB_TOKEN: ${{ inputs.github-token }}
44+
GITHUB_TOKEN: ${{ inputs.github-token || github.token }}
4545
ENTERPRISE: ${{ inputs.enterprise }}
4646
REPORT_DIR: ${{ inputs.report-dir }}
4747
ORGS: ${{ inputs.orgs }}

enterprise/github-get-consumed-licenses/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: 'Report GitHub Enterprise consumed licence seat counts'
33
inputs:
44
github-token:
55
description: 'PAT with manage_billing:enterprise scope'
6-
required: true
6+
required: false
77
enterprise:
88
description: 'GitHub Enterprise slug'
99
required: true
@@ -17,7 +17,7 @@ runs:
1717
- name: Get consumed licenses
1818
shell: bash
1919
env:
20-
GITHUB_TOKEN: ${{ inputs.github-token }}
20+
GITHUB_TOKEN: ${{ inputs.github-token || github.token }}
2121
ENTERPRISE: ${{ inputs.enterprise }}
2222
API_URL_PREFIX: ${{ inputs.api-url-prefix }}
2323
run: ${{ github.action_path }}/github-get-consumed-licenses.sh

enterprise/github-get-public-repos/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: 'List all public repositories across all organizations in a GitHub
33
inputs:
44
github-token:
55
description: 'PAT with read:org and repo scope'
6-
required: true
6+
required: false
77
enterprise:
88
description: 'GitHub Enterprise slug'
99
required: true
@@ -33,7 +33,7 @@ runs:
3333
- name: Get public repositories
3434
shell: bash
3535
env:
36-
GITHUB_TOKEN: ${{ inputs.github-token }}
36+
GITHUB_TOKEN: ${{ inputs.github-token || github.token }}
3737
ENTERPRISE: ${{ inputs.enterprise }}
3838
REPORT_DIR: ${{ inputs.report-dir }}
3939
ORGS: ${{ inputs.orgs }}

org-admin/github-add-repo-collaborators-by-pattern/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: 'Add individual collaborators to repositories whose names match a r
33
inputs:
44
github-token:
55
description: 'PAT with repo and admin:org scope'
6-
required: true
6+
required: false
77
org:
88
description: 'GitHub organization name'
99
required: true
@@ -31,7 +31,7 @@ runs:
3131
- name: Add collaborators to matching repositories
3232
shell: bash
3333
env:
34-
GITHUB_TOKEN: ${{ inputs.github-token }}
34+
GITHUB_TOKEN: ${{ inputs.github-token || github.token }}
3535
ORG: ${{ inputs.org }}
3636
COLLABORATORS: ${{ inputs.collaborators }}
3737
REPO_NAME_REGEX: ${{ inputs.repo-name-regex }}

org-admin/github-add-repo-permissions/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: 'Grant team permissions across all repositories in a GitHub organiz
33
inputs:
44
github-token:
55
description: 'PAT with admin:org scope'
6-
required: true
6+
required: false
77
org:
88
description: 'GitHub organization name'
99
required: true
@@ -41,7 +41,7 @@ runs:
4141
- name: Grant team permissions to repositories
4242
shell: bash
4343
env:
44-
GITHUB_TOKEN: ${{ inputs.github-token }}
44+
GITHUB_TOKEN: ${{ inputs.github-token || github.token }}
4545
ORG: ${{ inputs.org }}
4646
REPO_NAME_FILTER: ${{ inputs.repo-name-filter }}
4747
REPO_ADMIN: ${{ inputs.repo-admin }}

org-admin/github-archive-old-repos/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: 'Archive repositories that have not been updated within a configura
33
inputs:
44
github-token:
55
description: 'PAT with repo scope'
6-
required: true
6+
required: false
77
org:
88
description: 'GitHub organization name'
99
required: true
@@ -29,7 +29,7 @@ runs:
2929
- name: Archive old repositories
3030
shell: bash
3131
env:
32-
GITHUB_TOKEN: ${{ inputs.github-token }}
32+
GITHUB_TOKEN: ${{ inputs.github-token || github.token }}
3333
ORG: ${{ inputs.org }}
3434
YEARS_THRESHOLD: ${{ inputs.years-threshold }}
3535
REPORT_DIR: ${{ inputs.report-dir }}

org-admin/github-auto-repo-creation/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: 'Create private repositories with branch protection, CODEOWNERS, an
33
inputs:
44
github-token:
55
description: 'PAT with repo and admin:org scope'
6-
required: true
6+
required: false
77
org:
88
description: 'GitHub organization name'
99
required: true
@@ -27,7 +27,7 @@ runs:
2727
- name: Create repositories
2828
shell: bash
2929
env:
30-
GITHUB_TOKEN: ${{ inputs.github-token }}
30+
GITHUB_TOKEN: ${{ inputs.github-token || github.token }}
3131
ORG: ${{ inputs.org }}
3232
REPO_NAMES: ${{ inputs.repo-names }}
3333
REPO_OWNERS: ${{ inputs.repo-owners }}

org-admin/github-close-archived-repo-security-alerts/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: 'Dismiss all open Dependabot, code-scanning, and secret-scanning al
33
inputs:
44
github-token:
55
description: 'PAT with security_events and repo scope'
6-
required: true
6+
required: false
77
org:
88
description: 'GitHub organization name'
99
required: true
@@ -37,7 +37,7 @@ runs:
3737
- name: Close archived repo security alerts
3838
shell: bash
3939
env:
40-
GITHUB_TOKEN: ${{ inputs.github-token }}
40+
GITHUB_TOKEN: ${{ inputs.github-token || github.token }}
4141
ORG: ${{ inputs.org }}
4242
DEPENDABOT_REASON: ${{ inputs.dependabot-reason }}
4343
CODE_SCANNING_REASON: ${{ inputs.code-scanning-reason }}

org-admin/github-enable-issues/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: 'Enable the Issues feature on all repositories where it is currentl
33
inputs:
44
github-token:
55
description: 'PAT with repo or admin:org scope'
6-
required: true
6+
required: false
77
org:
88
description: 'GitHub organization name'
99
required: true
@@ -21,7 +21,7 @@ runs:
2121
- name: Enable Issues on repositories
2222
shell: bash
2323
env:
24-
GITHUB_TOKEN: ${{ inputs.github-token }}
24+
GITHUB_TOKEN: ${{ inputs.github-token || github.token }}
2525
ORG: ${{ inputs.org }}
2626
API_URL_PREFIX: ${{ inputs.api-url-prefix }}
2727
run: |

0 commit comments

Comments
 (0)