From ede416f9fee2667fb2a3701ae9355a0001d07487 Mon Sep 17 00:00:00 2001 From: Larry Chen Date: Wed, 3 Dec 2025 15:54:15 +0800 Subject: [PATCH 1/2] feat: use PAT push tag Signed-off-by: Larry Chen --- .github/actions/git-tag/action.yml | 5 ++++- .github/actions/git-tag/scripts/tag.sh | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/actions/git-tag/action.yml b/.github/actions/git-tag/action.yml index afad11d..bce331d 100644 --- a/.github/actions/git-tag/action.yml +++ b/.github/actions/git-tag/action.yml @@ -4,7 +4,9 @@ inputs: tag: description: "The tag name to create and push" required: true - + github_token: + description: "GitHub token for git tag" + required: true runs: using: "composite" steps: @@ -12,5 +14,6 @@ runs: shell: bash env: INPUT_TAG: ${{ inputs.tag }} + INPUT_GITHUB_TOKEN: ${{ inputs.github_token }} run: | "${{ github.action_path }}/scripts/tag.sh" diff --git a/.github/actions/git-tag/scripts/tag.sh b/.github/actions/git-tag/scripts/tag.sh index a79b101..ba3ee85 100755 --- a/.github/actions/git-tag/scripts/tag.sh +++ b/.github/actions/git-tag/scripts/tag.sh @@ -49,7 +49,12 @@ main() { fi log_info "Pushing tag: $tag" - git push origin "$tag" + + if [[ -n "${INPUT_GITHUB_TOKEN:-}" ]]; then + git push "https://${INPUT_GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" "$tag" + else + git push origin "$tag" + fi } main "$@" From e4a07d7b346e0e36d321c99030eb5c4935575398 Mon Sep 17 00:00:00 2001 From: Larry Chen Date: Thu, 4 Dec 2025 10:53:05 +0800 Subject: [PATCH 2/2] feat: Add token args in the git tag action Signed-off-by: Larry Chen --- .github/actions/git-tag/README.md | 2 ++ .github/actions/git-tag/action.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/git-tag/README.md b/.github/actions/git-tag/README.md index 7912751..c52e55e 100644 --- a/.github/actions/git-tag/README.md +++ b/.github/actions/git-tag/README.md @@ -17,6 +17,7 @@ steps: uses: NVIDIA/dsx-github-actions/.github/actions/git-tag@main with: tag: "v1.0.0" + github_token: ${{ secrets.GITHUB_TOKEN }} ``` ## Inputs @@ -24,6 +25,7 @@ steps: | Input | Description | Required | Default | | :--- | :--- | :--- | :--- | | `tag` | The tag name to create and push. | `true` | N/A | +| `github_token` | GitHub token for git authentication. Use a PAT to trigger subsequent workflows. | `true` | N/A | ## Behavior diff --git a/.github/actions/git-tag/action.yml b/.github/actions/git-tag/action.yml index bce331d..96814af 100644 --- a/.github/actions/git-tag/action.yml +++ b/.github/actions/git-tag/action.yml @@ -5,7 +5,7 @@ inputs: description: "The tag name to create and push" required: true github_token: - description: "GitHub token for git tag" + description: "GitHub token for git tag. Use a PAT to trigger subsequent workflows." required: true runs: using: "composite"