-
Couldn't load subscription status.
- Fork 10
feat(test): create token on the fly #374
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?
Conversation
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.
Pull Request Overview
This PR introduces a new GitHub Action that fetches ephemeral GitHub tokens from Vault using OIDC authentication. The action generates a unique role name based on the workflow reference and retrieves tokens dynamically.
- Adds a new composite action for token retrieval from Vault
- Creates documentation and test workflow for the new action
- Updates the no-test workflow to exclude the new action from testing
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| elastic/token/action.yml | Main action implementation for token retrieval from Vault |
| elastic/token/README.md | Documentation and usage examples for the new action |
| .github/workflows/test-fetch-token.yml | Test workflow to validate the token action |
| .github/workflows/no-test.yml | Excludes elastic/token from no-test workflow |
tests docs
ea32f85 to
fc48e08
Compare
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.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| skip-token-revoke: | ||
| description: 'Revoke the Vault token on exit' | ||
| default: false |
Copilot
AI
Oct 8, 2025
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 'skip-token-revoke' input is defined but never used in the action steps. Either implement the token revocation logic or remove this unused input parameter.
| skip-token-revoke: | |
| description: 'Revoke the Vault token on exit' | |
| default: false |
Co-authored-by: Copilot <[email protected]>
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.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Co-authored-by: Copilot <[email protected]>
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.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
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.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
elastic/token/action.yml
Outdated
| echo "Workflow ref: $GITHUB_WORKFLOW_REF" | ||
|
|
||
| # Generate role name using SHA-256 hash of workflow_ref | ||
| WORKFLOW_HASH=$(echo -n "$GITHUB_WORKFLOW_REF" | sha256sum | cut -c1-12) |
Copilot
AI
Oct 10, 2025
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.
Using only the first 12 characters of a SHA-256 hash creates a risk of collisions. Consider using a longer hash (e.g., 16-20 characters) or the full hash to ensure uniqueness across different workflows.
| WORKFLOW_HASH=$(echo -n "$GITHUB_WORKFLOW_REF" | sha256sum | cut -c1-12) | |
| WORKFLOW_HASH=$(echo -n "$GITHUB_WORKFLOW_REF" | sha256sum | cut -c1-20) |
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.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
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.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
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.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
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.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
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.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
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.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| id-token: write | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: ./elastic/github-token |
Copilot
AI
Oct 10, 2025
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 action path './elastic/token' is incorrect. It should be './elastic/github-token' to match the actual directory structure of the action being tested.
| - uses: ./elastic/github-token | |
| - uses: ./elastic/github-token |
No description provided.