34 lines
958 B
Markdown
34 lines
958 B
Markdown
Examples:
|
|
```
|
|
on: [push]
|
|
|
|
jobs:
|
|
hello_world_job:
|
|
runs-on: ubuntu-latest
|
|
name: A job to say hello
|
|
steps:
|
|
-
|
|
name: Checkout repo
|
|
uses: actions/checkout@v4
|
|
with:
|
|
# Number of commits to fetch. 0 indicates all history for all branches and tags.
|
|
# Default: 1
|
|
fetch-depth: '0'
|
|
-
|
|
name: Get current env
|
|
id: foo
|
|
uses: actions/git-tag@main
|
|
|
|
-
|
|
shell: bash
|
|
run: |
|
|
echo Git build type "$BUILD_TYPE"
|
|
echo Git branch name "$BUILD_BRANCH_NAME"
|
|
echo Git tag Description "$BUILD_TAG_DESC"
|
|
echo Git short tag "$BUILD_GIT_SHA_SHORT"
|
|
env:
|
|
BUILD_TYPE: ${{ steps.foo.outputs.git_build_type }}
|
|
BUILD_BRANCH_NAME: ${{ steps.foo.outputs.git_branch_name }}
|
|
BUILD_TAG_DESC: ${{ steps.foo.outputs.git_tag_desc }}
|
|
BUILD_TAG_SHORT: ${{ steps.foo.outputs.git_sha_short }}
|
|
``` |