https://github.com/romnn/query-git-action
query the state of your git repo.
https://github.com/romnn/query-git-action
actions ci git version-management
Last synced: 13 days ago
JSON representation
query the state of your git repo.
- Host: GitHub
- URL: https://github.com/romnn/query-git-action
- Owner: romnn
- License: mit
- Created: 2021-01-15T15:33:03.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-03-07T18:58:27.000Z (almost 2 years ago)
- Last Synced: 2025-01-19T08:43:40.003Z (12 months ago)
- Topics: actions, ci, git, version-management
- Language: TypeScript
- Homepage:
- Size: 243 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## query git action
GitHub action to query the state of your git repo.
**Note:** Requires `git` to be installed on the runner.
#### Usage
```yaml
# .github/workflows/ci.yml
name: ci
on: [push, pull_request]
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: query git repo
id: query
uses: romnn/query-git-action@main
- name: show output variables
run: |
echo "${{ steps.query.outputs.git_commit }}"
echo "${{ steps.query.outputs.scm_status }}"
echo "${{ steps.query.outputs.tree_state }}"
echo "${{ steps.query.outputs.scm_revision }}"
echo "${{ steps.query.outputs.major_version }}"
echo "${{ steps.query.outputs.minor_version }}"
echo "${{ steps.query.outputs.docker_tag }}"
echo "${{ steps.query.outputs.semver_version }}"
echo "${{ steps.query.outputs.build_date }}"
echo "${{ steps.query.outputs.github_repo_user }}"
echo "${{ steps.query.outputs.github_repo_name }}"
```
#### Development
```bash
# find a tagged commit
git show-ref --tags
# use that commit during development
GIT_COMMIT= yarn run run
```