Skip to content

test git action

test git action #5

Workflow file for this run

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)