Skip to content

Instantly share code, notes, and snippets.

@m1yag1
Created September 4, 2021 01:20
Show Gist options
  • Save m1yag1/fb82d5bf84006d0c9087322d5179572d to your computer and use it in GitHub Desktop.
Save m1yag1/fb82d5bf84006d0c9087322d5179572d to your computer and use it in GitHub Desktop.
Get the latest sha for a git repo within a Concourse task
---
platform: linux
image_resource:
type: registry-image
source:
password: ((ce-dockerhub-token))
repository: alpine/git
username: ((ce-dockerhub-id))
inputs:
- name: source-code
outputs:
- name: sha
run:
path: sh
args:
- -cxe
- |
git --git-dir=source-code/.git rev-parse --short HEAD > sha/sha
cat sha/sha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment