Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ repos:
args: [ "--fix", "--unsafe-fixes"] # Allow unsafe fixes (ruff pretty strict about what it can fix)
- id: ruff-format
- repo: https://github.com/djlint/djLint
rev: v1.46.1
rev: v1.46.2
hooks:
- id: djlint-reformat-django
- id: djlint-django
Expand Down Expand Up @@ -61,7 +61,7 @@ repos:
exclude: "README.md"
# Central hooks
- repo: https://github.com/phantomcyber/dev-cicd-tools
rev: v2.2.10
rev: v2.2.12
hooks:
- id: build-docs
language: python
Expand Down
11 changes: 8 additions & 3 deletions git_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,18 @@ def _set_repo_attributes(self, param={}):
"""

configured_repo_uri = self.config.get(consts.GIT_CONFIG_REPO_URI)
configured_repo_name = self.config.get(consts.GIT_CONFIG_REPO_NAME)
configured_branch_name = self.config.get(consts.GIT_CONFIG_BRANCH_NAME, "master")
configured_access_token = self.config.get("access_token")
requested_repo_uri = param.get("repo_url")
self.repo_uri = requested_repo_uri or self.repo_uri
self.branch_name = param.get("branch") or self.branch_name
self.repo_uri = requested_repo_uri or configured_repo_uri
self.repo_name = configured_repo_name
self.branch_name = param.get("branch") or configured_branch_name
self.modified_repo_uri = self.repo_uri
self.ssh = False
supplied_access_token = param.get("access_token")
use_asset_credentials = not requested_repo_uri or self._same_remote(configured_repo_uri, requested_repo_uri)
self.access_token = supplied_access_token or (self.access_token if use_asset_credentials else None)
self.access_token = supplied_access_token or (configured_access_token if use_asset_credentials else None)

# create another copy so that URL with password is not displayed during test_connectivity action
try:
Expand Down
2 changes: 2 additions & 0 deletions release_notes/unreleased.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
**Unreleased**

* Reset per-parameter repository state before applying asset credentials.
Loading