Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insufficient repository fetch-depth for action workflows #109

Merged

Conversation

svengreb
Copy link
Owner

Fixes #108

The GitHub action workflows [1] using the `actions/checkout` action [2]
to fetch the repository that triggered the workflow. However, by default
only the history of the latest commit was fetched which resulted in
errors when wand tried to extract repository metadata information like
the amount of commits ahead of the latest commit. As an example this
can be seen when running the `bootstrap` command in the `test` job of
the `ci-go` workflow [5] which failed with an `object not found` error
because the history only contains a single commit.

To fix this problem `action/checkout` provides an option to fetch all
history for all tags and branches [3] which is now used to prevent
errors like this in the pipeline.

[1]: https://github.com/svengreb/wand/tree/9caf10f9d3b0c97e1f6c18b29c175e71764b0ece/.github/workflows
[2]: https://github.com/actions/checkout
[3]: https://github.com/actions/checkout#Fetch-all-history-for-all-tags-and-branches
[4]: https://github.com/svengreb/wand/blob/cabd635c4ec73680b1776e7c536feca16643b00b/magefile.go#L136
[5]: https://github.com/svengreb/wand/runs/4275275079?check_suite_focus=true

GH-108
@svengreb svengreb added this to the Next milestone Nov 21, 2021
@svengreb svengreb self-assigned this Nov 21, 2021
@svengreb svengreb merged commit c39b2c4 into main Nov 21, 2021
@svengreb svengreb deleted the bugfix/gh-108-insufficient-repo-fetch-depth-workflows branch November 21, 2021 10:16
@svengreb svengreb removed their assignment Nov 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Insufficient repository fetch-depth for action workflows
1 participant