Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/actions/merge-main/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ description: Merges main into feature branches (*-main)
inputs:
exempt-branches:
description: Feature branches that are exempt from receiving merges from main (comma separated, no blank space)
ci-user-pat:
description: The CI user's personal access token to write to the repo
Comment on lines +6 to +7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need to be an input, is this not accessible through {{ secrets.CI_USER_PAT }} (using the secrets from whichever repo invoked this action)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, secrets are not accessible through the action. You can see a run here where it didn't work:
https://github.com/awslabs/aws-kotlin-repo-tools/actions/runs/14479267339/job/40612416547

I think I found a better way to pass secrets to the action than what I'm using now:
https://docs.github.com/en/actions/sharing-automations/reusing-workflows#passing-inputs-and-secrets-to-a-reusable-workflow

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually never mind the "better" way, it seems like it doesn't work for actions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entire merge-main process could probably be restructured as a reusable workflow instead of an action, but I think it's out of scope for now


runs:
using: composite
Expand All @@ -11,6 +13,7 @@ runs:
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ inputs.ci-user-pat }}

- name: Set up Git
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/merge-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ jobs:
- name: Merge main
uses: awslabs/aws-kotlin-repo-tools/.github/actions/merge-main@main
with:
ci-user-pat: ${{ secrets.CI_USER_PAT }}
exempt-branches: # Add any if required