Skip to content

Conversation

@reakaleek
Copy link
Member

@reakaleek reakaleek commented May 18, 2024

Adds the google/auth action — an opinionated action to authenticate with the elastic-observability GCP project.

@reakaleek reakaleek requested a review from a team May 18, 2024 20:23
@reakaleek reakaleek self-assigned this May 18, 2024
@reakaleek reakaleek added the changelog:feature When you add a new feature label May 18, 2024
id: generate-workload-identity-pool-provider-id
run: |
HASH=$(echo -n "${GITHUB_REPOSITORY}" | sha256sum | cut -c1-27)
echo "workload_identity_provider_id=repo-${HASH}" >> "${GITHUB_OUTPUT}"
Copy link
Member

Choose a reason for hiding this comment

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

A few questions:

  • Do we want to support Windows?
  • Should the output be exported too?

Copy link
Member Author

@reakaleek reakaleek May 20, 2024

Choose a reason for hiding this comment

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

Do we want to support Windows?

Do we have an existing use case for Windows? If not, I'd rather add it when it becomes necessary.
Otherwise, we slightly increase the complexity for no reason.

Should the output be exported too?

I don't see why one would need the workload identity pool id.
I might be wrong, but I think we should only add it if we already see a reason for it. Otherwise, we can always add it later.

P.S.

Of course, if you already know any of this is needed, I'm happy to add it.

Copy link
Member Author

Choose a reason for hiding this comment

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

With the latest changes, I actually addressed both points.

  • Added outputs to be able to test the output
  • Changed the hash-generating script to Python to make it cross-platform compatible.

HASH=$(echo -n "${GITHUB_REPOSITORY}" | sha256sum | cut -c1-27)
echo "workload_identity_provider_id=repo-${HASH}" >> "${GITHUB_OUTPUT}"
shell: bash
- uses: google-github-actions/auth@v2
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to pin versions?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

@v1v v1v left a comment

Choose a reason for hiding this comment

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

OTOH, do you think we should add some kind of tests?

I'll ping you in an internal github issue

@reakaleek reakaleek requested a review from v1v May 21, 2024 22:38
Copy link
Member

@v1v v1v left a comment

Choose a reason for hiding this comment

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

LGTM, I like the approach for testing the action! 💯

@reakaleek reakaleek merged commit c38f68f into main May 22, 2024
@reakaleek reakaleek deleted the feature/google-auth branch May 22, 2024 08:31
v1v added a commit to v1v/oblt-actions that referenced this pull request May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:feature When you add a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants