mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-30 03:26:13 +01:00
do the sha generation on master
This commit is contained in:
parent
92fb06c691
commit
5860ad3f1d
34
.github/workflows/sha.yml
vendored
Normal file
34
.github/workflows/sha.yml
vendored
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
name: SHA
|
||||||
|
|
||||||
|
# Run this workflow ever time code is pushed to a branch
|
||||||
|
# other than `main` in your repository
|
||||||
|
on: push
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
# Set the job key. The key is displayed as the job name
|
||||||
|
# when a job name is not provided
|
||||||
|
sha:
|
||||||
|
# Name the Job
|
||||||
|
name: Commit SHA
|
||||||
|
# Set the type of machine to run on
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
if: contains(github.ref, "master")
|
||||||
|
steps:
|
||||||
|
# Checks out a copy of your repository on the ubuntu-latest machine
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Create SHA File
|
||||||
|
run: |
|
||||||
|
sha=$(git rev-parse --short "$GITHUB_SHA")
|
||||||
|
echo "#define GITHUB_SHA \"$sha\"" > GITHUB_SHA.h
|
||||||
|
|
||||||
|
- uses: EndBug/add-and-commit@v4 # You can change this to use a specific version
|
||||||
|
with:
|
||||||
|
add: 'GITHUB_SHA.h'
|
||||||
|
message: 'Committing a SHA'
|
||||||
|
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged
|
||||||
|
|
Loading…
Reference in New Issue
Block a user