Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .github/actions/git-tag/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ steps:
uses: NVIDIA/dsx-github-actions/.github/actions/git-tag@main
with:
tag: "v1.0.0"
github_token: ${{ secrets.GITHUB_TOKEN }}
```

## Inputs

| 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

Expand Down
5 changes: 4 additions & 1 deletion .github/actions/git-tag/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ inputs:
tag:
description: "The tag name to create and push"
required: true

github_token:
description: "GitHub token for git tag. Use a PAT to trigger subsequent workflows."
required: true
runs:
using: "composite"
steps:
- name: Tag and Push
shell: bash
env:
INPUT_TAG: ${{ inputs.tag }}
INPUT_GITHUB_TOKEN: ${{ inputs.github_token }}
run: |
"${{ github.action_path }}/scripts/tag.sh"
7 changes: 6 additions & 1 deletion .github/actions/git-tag/scripts/tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$@"