-
Notifications
You must be signed in to change notification settings - Fork 0
Auto-PR: fix: replace GitHub App token with PAT for human PR attribution #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,25 +19,16 @@ jobs: | |
| create-pr: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Generate GitHub App Token | ||
| id: generate-token | ||
| uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1 | ||
| with: | ||
| app-id: ${{ secrets.APP_ID }} | ||
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | ||
| owner: ${{ github.repository_owner }} | ||
| repositories: ${{ github.event.repository.name }} | ||
|
|
||
| - name: Checkout repository | ||
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| token: ${{ steps.generate-token.outputs.token }} | ||
| token: ${{ secrets.ROMAN_PAT }} | ||
|
||
|
|
||
| - name: Create Pull Request | ||
| id: create-pr | ||
| env: | ||
| GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | ||
| GITHUB_TOKEN: ${{ secrets.ROMAN_PAT }} | ||
|
||
| run: | | ||
| # Get current branch name | ||
| BRANCH_NAME="${{ github.ref_name }}" | ||
|
|
@@ -65,7 +56,7 @@ jobs: | |
| FIRST_COMMIT=$(git log --format=%s -1 "$BRANCH_NAME") | ||
| fi | ||
|
|
||
| # Fallback if no unique commits are found or subject is empty | ||
| # Fallback if FIRST_COMMIT is empty | ||
| if [ -z "$FIRST_COMMIT" ]; then | ||
| # Determine commit count compared to target branch when possible | ||
| if git rev-parse --verify "origin/$TARGET_BRANCH" >/dev/null 2>&1; then | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The naming convention "ROMAN_PAT" creates operational risks by tying infrastructure automation to an individual user account. This violates SOC2 accountability and service continuity best practices:
Consider using a service account pattern or GitHub App with a name like "WEOWN_AUTOMATION_APP" or "WORKFLOW_GITHUB_TOKEN" that clearly indicates this is infrastructure automation, not personal activity.