Skip to content

docs: Add blog post for using pac git auth secret to avoid rate limit #2190

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chmouel
Copy link
Member

@chmouel chmouel commented Jul 30, 2025

docs: Add guide for Git authentication secret to avoid rate limits

πŸ”— Linked GitHub Issue

Fixes #

πŸ‘¨πŸ»β€ Linked Jira

πŸš€ Type of Change

  • πŸ› Bug fix (fix:)
  • ✨ New feature (feat:)
  • πŸ’₯ Breaking change (feat!:, fix!:)
  • πŸ“š Documentation update (docs:)
  • βš™οΈ Chore (chore:)
  • πŸ’… Refactor (refactor:)
  • πŸ”§ Enhancement (enhance:)

πŸ§ͺ Testing Strategy

  • Unit tests
  • Integration tests
  • End-to-end tests
  • Manual testing
  • Not Applicable

βœ… Submitter Checklist

  • πŸ“ My commit messages are clear, informative, and follow the project's How to write a git commit message guide. The Gitlint linter ensures in CI it's properly validated
  • ✨ I have ensured my commit message prefix (e.g., fix:, feat:) matches the "Type of Change" I selected above.
  • β™½ I have run make test and make lint locally to check for and fix any
    issues. For an efficient workflow, I have considered installing
    pre-commit and running pre-commit install to
    automate these checks.
  • πŸ“– I have added or updated documentation for any user-facing changes.
  • πŸ§ͺ I have added sufficient unit tests for my code changes.
  • 🎁 I have added end-to-end tests where feasible. See README for more details.
  • πŸ”Ž I have addressed any CI test flakiness or provided a clear reason to bypass it.
  • If adding a provider feature, I have filled in the following and updated the provider documentation:
    • GitHub App
    • GitHub Webhook
    • Gitea/Forgejo
    • GitLab
    • Bitbucket Cloud
    • Bitbucket Data Center

@Copilot Copilot AI review requested due to automatic review settings July 30, 2025 09:18
@chmouel chmouel changed the title ## πŸ“ Description of the Change Add blog post for using pac git auth secret to avoid rate limit Jul 30, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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 adds a comprehensive documentation guide explaining how to use Pipelines-as-Code's git_auth_secret variable to avoid rate limiting when fetching Git resources and accessing private repositories.

  • Introduces a new blog post documenting the git_auth_secret feature and its usage patterns
  • Provides step-by-step instructions for implementing authenticated Git operations in Tekton pipelines
  • Includes practical examples showing pipeline design and PipelineRun configuration

@chmouel chmouel changed the title Add blog post for using pac git auth secret to avoid rate limit docs: Add blog post for using pac git auth secret to avoid rate limit Jul 30, 2025
@chmouel chmouel force-pushed the docs-add-guide-for-git-authentication-secret-to-av branch from 7b28a50 to c5a478e Compare July 30, 2025 09:22
*   Added new blog post
`using-pac-git-auth-secret-to-avoid-rate-limiting.md`.
*   Explained how to use PaC's `{{ git_auth_secret }}` for authenticated
Git
operations.
*   Described how this mechanism helps prevent Git provider rate
limiting.
*   Demonstrated accessing private Git resources securely within Tekton
pipelines.
*   Updated `.gitignore` to exclude `.gemini` files.

Co-authored-by: Gemini - gemini-2.5-pro
Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
@chmouel chmouel force-pushed the docs-add-guide-for-git-authentication-secret-to-av branch from c5a478e to e18cd46 Compare July 30, 2025 09:22
@chmouel
Copy link
Member Author

chmouel commented Jul 30, 2025


Pipelines-as-Code (PaC) solves this elegantly by automatically generating a temporary, scoped authentication token for each `PipelineRun`. This token is stored in a Kubernetes `Secret`, and its name is made available to your `PipelineRun` through the built-in `{{ git_auth_secret }}` variable.

This guide shows how to use `{{ git_auth_secret }}` to enable authenticated Git operations with the `git` resolver, helping you avoid rate-limiting and access private resources securely.

Choose a reason for hiding this comment

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


You do not need to create any secrets manually. Simply reference the PaC variable `{{ git_auth_secret }}` in your `PipelineRun` template file (e.g., `.tekton/pipelinerun.yaml`).

PaC will substitute this placeholder with the name of the auto-generated secret at runtime.

Choose a reason for hiding this comment

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

This has a big limitation; it means that both the referred pipeline/task , and the project being built share the Git forge, IOW that the generated PaC secret may be used to authenticate against both of the repositories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants