Skip to content

Commit 0b927a3

Browse files
authored
fix: don't require GH PAT (#5)
## what - Don't require GH PAT for the inputs. ## why - Not needed if the App credentials are provided ## references - https://github.com/masterpointio/terraform-aws-tailscale/actions/runs/17371457915/job/49308008044 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added support for authentication via GitHub App credentials (app ID and private key) as an alternative to a personal access token. * Automatic token selection at runtime chooses between provided token and generated App token. * Auto-merge and upgrade steps now use the selected token for consistent authentication. * **Refactor** * Updated workflow to accommodate dual authentication modes and streamlined control flow. * **Documentation** * Clarified input descriptions to reflect optional token and newly supported GitHub App credentials. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 6744328 commit 0b927a3

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

action.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,32 @@ author: [email protected]
44

55
inputs:
66
github-token:
7-
description: GitHub token for creating PRs and performing operations
8-
required: true
7+
description: GitHub token for creating PRs and performing operations (required if app credentials not provided)
98

109
app-id:
1110
description: GitHub App ID for bot authentication
12-
required: false
1311

1412
app-private-key:
1513
description: GitHub App private key for bot authentication
16-
required: false
1714

1815
reviewers:
1916
description: Reviewers to assign to the PR (e.g., '@org/team' or 'user1,user2')
20-
required: false
2117
default: ""
2218

2319
prefix:
2420
description: Prefix for commit messages and PR titles
25-
required: false
2621
default: "chore: "
2722

2823
merge-method:
2924
description: Method to use for merging (squash, merge, rebase)
30-
required: false
3125
default: squash
3226

3327
check-timeout-minutes:
3428
description: Maximum time to wait for status checks (in minutes)
35-
required: false
3629
default: "10"
3730

3831
check-interval-seconds:
3932
description: Interval between status check polls (in seconds)
40-
required: false
4133
default: "30"
4234

4335
outputs:
@@ -59,8 +51,9 @@ runs:
5951
- name: Validate inputs
6052
shell: bash
6153
run: |
62-
if [[ -z "${{ inputs.github-token }}" ]]; then
63-
echo "::error::github-token is required"
54+
# Ensure either github-token OR app credentials are provided
55+
if [[ -z "${{ inputs.github-token }}" && ( -z "${{ inputs.app-id }}" || -z "${{ inputs.app-private-key }}" ) ]]; then
56+
echo "::error::Either github-token must be provided, or both app-id and app-private-key must be provided"
6457
exit 1
6558
fi
6659
@@ -100,7 +93,7 @@ runs:
10093
id: auto-merge
10194
shell: bash
10295
env:
103-
GH_TOKEN: ${{ inputs.github-token }}
96+
GH_TOKEN: ${{ steps.github-token.outputs.token }}
10497
PR_NUMBER: ${{ steps.trunk-upgrade.outputs.pull-request-number }}
10598
REPO_URL: https://github.com/${{ github.repository }}
10699
MERGE_METHOD: ${{ inputs.merge-method }}

0 commit comments

Comments
 (0)