test git action #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v1 | |
# - name: Get Branch | |
# id: branch | |
# run: echo "git_branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_BRANCH | |
- name: Check Branch | |
run: echo "${{ env.branch }}" | |
# - name: Get Hash | |
# id: hash | |
# run: echo "git_hash=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_HASH | |
- name: Check Hash | |
run: echo "${{ env.hash }}" | |
- name: Declare some variables | |
shell: bash | |
run: | | |
echo "sha_short=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV" | |
echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> "$GITHUB_ENV" | |
- name: Another step | |
run: | | |
echo "Branch: ${{ env.branch }}" | |
echo "Sha: ${{ env.sha_short }}" | |
- name: BRANCH_NAME | |
run: $(echo $GITHUB_REF | cut -d'/' -f 3) | |
- name: GITHUB_SHA_SHORT | |
run: $(echo $GITHUB_SHA | cut -c1-7) |