I have a workflow configured to run only when a release tag is created.
Example job and workflow definitions:
jobs:
my_job:
steps:
- checkout
- run: more_stuff
workflows:
version: 2
my_workflow:
jobs:
- my_job:
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
When I create an annotated tag (git tag -a my-annotated-tag
) and push it to GitHub, my_workflow
runs as expected, but my_job
fails during Checkout code
with one of these two outputs:
Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Compressing objects: 100% (7/7), done.
Total 3493 (delta 1), reused 2 (delta 1), pack-reused 3485
reference not found
or
Enumerating objects: 24, done.
Counting objects: 100% (24/24), done.
Compressing objects: 100% (18/18), done.
Total 3839 (delta 5), reused 18 (delta 4), pack-reused 3815
object not found
However, if I create a lightweight git tag (git tag my-lightweight-tag
), Checkout code
is successful. My hypothesis is that the object/reference that is not found is the annotated tag and that it is missing because CircleCI is doing a shallow clone against a hash, thereby excluding the tag object.
I strongly prefer using annotated tags over lightweight tags for releases, so this is a major issue.