Skip to content
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

feat: Add possibility to dissociate token for source and destination repository #174

Closed
wants to merge 1 commit into from

Conversation

sebastienrospars
Copy link

Hi,

Thank you for developing this valuable action! It's been very helpful. However, for our specific business needs, we require the ability to specify two separate tokens.

In our scenario, we use a PAT from another organization to read content from a source repository. Unfortunately, this PAT does not grant access to our repository within our organization.

The purpose of this PR is to introduce the option to specify a dedicated token for the destination repository. This new parameter is optional; in its absence, the system will default to using the existing token. I've retained the original token parameter name to maintain backward compatibility.

I appreciate your time in reviewing this PR and look forward to your feedback.

Thank you.

@andrewthetechie
Copy link
Owner

andrewthetechie commented Jan 30, 2024

@sebastienrospars thanks for your contribution. I'd be happy to include your feature, but it'll need some changes before it can be merged.

First, to add an input to the action, you need to add it to the action.yaml. Adding the token here and running pre-commit will add it to the code automatically.

This repo uses Conventional Commits to automate releases. You'll need to edit your commit message and PR title to match conventional commits. This is a feat: change.

I'll add some additional comments on the PR for two other needed changes.

@@ -12,6 +12,7 @@
###START_INPUT_AUTOMATION###
INPUTS = {
"token": {"description": "Github token", "required": True},
"dest_token": {"description": "Github token for destination repo", "required": False},
Copy link
Owner

Choose a reason for hiding this comment

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

Remove this line and add your new input to action.yaml, then run make generate-inputs (or run pre-commit). This is generated automatically from action.yaml.

Copy link
Author

Choose a reason for hiding this comment

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

I'm not familiar with python pre-commit, and i don't have python environment in my computer. So do the job with hand, it's okay for you ?

README.md Outdated Show resolved Hide resolved
@andrewthetechie andrewthetechie self-assigned this Jan 30, 2024
@andrewthetechie
Copy link
Owner

Don't worry about the CI failures. They don't run well on forked PRs. I'll make sure they all pass before merging.

@sebastienrospars sebastienrospars changed the title Add possibility to dissociate token for source and destination repository feat: Add possibility to dissociate token for source and destination repository Jan 30, 2024
@sebastienrospars
Copy link
Author

sebastienrospars commented Jan 30, 2024

Thanks @andrewthetechie for your response, I update PR and commit to respect Conventional commit, and I add dist_token in actions.yaml. I hope it's good for you.

Regards

@andrewthetechie
Copy link
Owner

@sebastienrospars this PR will have to sit until this weekend when I have some free time to merge it and get a release out.

@sebastienrospars
Copy link
Author

Nice, thanks @andrewthetechie ! Thanks for your work 👍

@sebastienrospars
Copy link
Author

Hi @andrewthetechie do you have any update for the merge ?

andrewthetechie added a commit that referenced this pull request Feb 11, 2024
@andrewthetechie
Copy link
Owner

@sebastienrospars I'm working on implementing this feature in #185. I'm going to close this PR and work on that one. I'll ping you (via github comment) when its merged and released

andrewthetechie added a commit that referenced this pull request Feb 11, 2024
* feat: support a separate token for destination

This implements the feature @sebastienrospars suggested in
#174

* docs: automated doc update

* feat: use dest_token
@andrewthetechie
Copy link
Owner

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.

2 participants