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
# .github/workflows/version.yml | ||
name: Git Version | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} # checkout the correct branch name | ||
fetch-depth: 0 # fetch the whole repo history | ||
runs: | ||
using: 'node21' | ||
steps: | ||
# Reference a specific commit | ||
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 | ||
# Reference the major version of a release | ||
- uses: actions/checkout@v4 | ||
# Reference a specific version | ||
- uses: actions/[email protected] | ||
# Reference a branch | ||
- uses: actions/checkout@main | ||
- name: Git Version | ||
id: version | ||
uses: codacy/[email protected] | ||
- name: Cache | ||
uses: actions/[email protected] | ||
- name: Use the version | ||
run: | | ||
echo ${{ steps.version.outputs.version }} | ||
- name: Use the previous version | ||
run: | | ||
echo ${{ steps.version.outputs.previous-version }} | ||