Skip to content

Conversation

felddy
Copy link
Contributor

@felddy felddy commented Feb 22, 2020

🗣 Description

Add the iam-to-github tool. Creates GitHub secrets for use in GitHub Actions.

💭 Motivation and Context

We have a similar tool for our previous CI (Travis).
Terraform no longer displays the secret keys in show state.
This is a nice thing to have.

Features:

  • Requires a GitHub token (PAT), and detects everything else.
  • It will detect the repo itself, but it can be overridden with the --repo option.
  • I did a bit of future-proofing. We don't have any multi-user workflows yet, but this should
    handle those nicely. If more than one user is found it will inform the user how to proceed.
  • There is a --user option to be used to filter users down to one. And a --suffix option that can modify the names used to store secrets.

🧪 Testing

I tested this on a personal repository as well as cisago
v/ansible-role-dev-ssh-access

(@dav3r I may have clobbered any secrets you put out there. If the terraform state changed since we debugged it.)

📷 Screenshots (if appropriate)

Screen Shot 2020-02-22 at 16 14 34

Don't worry I rolled the key in the screenshot before I posted the image. 😛

🚥 Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (causes existing functionality to change)

✅ Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

mcdonnnj and others added 16 commits February 10, 2020 10:39
Cleanup Linux instructions and add WSL references to CONTRIBUTING.md
Update actions/checkout to v2
Update formatting to match downstream children
…n_and_checkout_action

Update Python and actions/checkout Versions
Update pre-commit hooks (and flip Actions cache order in workflow).
Adds the ability to filter users.  Adds better pre-launch checks.  Adds 
ability to add suffixes to secret names.
@felddy felddy self-assigned this Feb 22, 2020
@felddy felddy marked this pull request as ready for review February 22, 2020 21:35
@felddy felddy requested review from a team, dav3r, jsf9k and mcdonnnj as code owners February 22, 2020 21:35
Copy link
Member

@jsf9k jsf9k left a comment

Choose a reason for hiding this comment

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

Approved, but please see my one comment/question.

Copy link
Member

@dav3r dav3r left a comment

Choose a reason for hiding this comment

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

This looks awesome- can't wait to use it! 🎸
I noted a few superficial items to clean up.

Copy link
Member

@mcdonnnj mcdonnnj left a comment

Choose a reason for hiding this comment

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

This looks really solid. Strong work 💪
I did have some superficial/preferential stuff for consideration.

@felddy felddy merged commit 84091a5 into develop Feb 24, 2020
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.

4 participants