-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Error: "fatal: not a git repository (or any of the parent directories): .git" #1384
Comments
This error appears when the action is run on a repo which is a shallow checkout (without tags) or not a git repo, if the action can't resolve the prior tag based on the API or if it wasn't passed. So the error itself isn't really a problem in that case. as based on your example, you run the action without a checkout at all. so it's expected. |
Ah, the checkout is below that as I was looking at the examples in the README and there is no checkout before it either. Also, it worked previously so I thought this is working as intended. I will try it with the steps switched out, so that the checkout comes first. |
To be specific. A checkout is not required, if the action has alternative means to get the from and to tag. it really depends on the usecase. Falling back to checking the current git state is only another mechanism to identify the current tag. usually the I feel like your overall problem comes from here: #1383 Given YEAR.MONTH.DAY should properly sort in all cases. |
Thank you, moving the checkout in front of the changelog step has fixed that error. However I still do not understand why it first finds 5 tags and then in the next step it does not find any other tags anymore even though I have not specified any filter. 🔖 Resolve tags |
Based on this ticket: #1383 (comment) I assume you also have a filter on the tags? Or in that case you have removed it? |
I have currently removed the filter as it was not working properly anyways. name: Release
on:
push:
tags: '[2-9][0-9]\.[0-9][0-9]'
jobs:
create-release:
name: Create release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create-release.outputs.upload_url }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Changelog
id: changelog
uses: mikepenz/release-changelog-builder-action@v5
with:
mode: "COMMIT"
configurationJson: |
{
"pr_template": "- #{{TITLE}}",
"template": "#{{UNCATEGORIZED}}",
}
- name: Install dependencies
run: sudo apt-get install -y raptor2-utils
- name: Build
id: build
run: |
scripts/combine | tee $GITHUB_STEP_SUMMARY
scripts/olsworkaround
echo 'summary<<EOF' >> $GITHUB_OUTPUT
cat ${GITHUB_STEP_SUMMARY} >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Create Release
id: create-release
uses: softprops/action-gh-release@v2
with:
body: |
${{ steps.build.outputs.summary }}
${{ steps.changelog.outputs.changelog }}
files: |
dist/anno.ttl
dist/anno-ols.ttl |
oh but you also removed the logic to enable the sort based tag handling. By default
you wanna use
|
But isn't 24.02 a valid semver version? For example Ubuntu Linux has been using that for a long time. |
Based on my understanding of See: https://jubianchi.github.io/semver-check/#/version/24.02 |
Ah, you are right. However in case anyone else is making the same mistake as I did, it would be helpful to document in the README that only valid semver tags following major.minor.patch will be picked up. |
In https://github.com/annosaxfdm/ontology/actions/runs/11439151403/job/31822224741, I get a fatal error:
Run mikepenz/release-changelog-builder-action@v5⚠️ No tag found for the given repository
📘 Reading input values
ℹ️ Retrieved configuration via 'configurationJson'.
ℹ️ Running in COMMIT mode.
🔖 Resolve tags
ℹ️ Found 5 (fetching max: 200) tags from the GitHub API for annosaxfdm/ontology
🔖 Resolved current tag (24.10) from the 'github.context.ref'
ℹ️ Only one tag found for the given repository. Usually this is the case for the initial release.
/usr/bin/git rev-list --max-parents=0 HEAD
fatal: not a git repository (or any of the parent directories): .git
Warning:
Error: 💥 Unable to retrieve previous tag given
The workflow starts as follows:
There are 5 tags, like "24.04" or "24.02", but they are not picked up.
I don't know if it is related, but before the warning about the missing tags there is " /usr/bin/git rev-list --max-parents=0 HEAD
fatal: not a git repository (or any of the parent directories): .git" and I wonder if that is causing the error.
The text was updated successfully, but these errors were encountered: