Comments (6)
I also ran into the error message fatal: bad object type.
in a reusable workflow. I unfortunately still don't know exactly what cause the issue but I was able to fix it by manually creating and pushing a new tag.
This may be a fundamentally different problem from yours but posting for anyone this might help:
- my action was failing to create a tag pointing to
HEAD
and my latest tag was forHEAD~2
- I manually created and pushed a tag for
HEAD~1
- the following action run was fixed and successfully created a tag for
HEAD
from action-create-tag.
I finally found something that seems to have worked. I changed the YAML stanza that I use to checkout the to-be-tagged repo to include the parameters fetch-depth: 0
and fetch-tags: true
. The resulting block now looks like this:
# https://github.com/actions/checkout
- uses: actions/checkout@v3
with:
ref: "${{ inputs.ref }}"
fetch-depth: 0
fetch-tags: true
I'll close this issue now. (If @0ui or others want to reopen it, knock your-collective-selves out.)
from action-create-tag.
Hey @cmpilato, great news on solving the issue! Apologies for the delayβI was enjoying a holiday in the sun. βοΈ
The fatal: bad object
error pops up when the Git ref is invalid, usually due to a typo or the ref not existing anymore.
In your code, focus on this section:
It appears the problem might be after:
git tag -fa "${TAG}" "${SHA}" -m "${MESSAGE}"
Given your use of force_push_tag
, the error likely lies in the SHA
variable. If commit_sha
isn't specified, it's sourced from GITHUB_SHA
:
GITHUB_SHA
value varies based on the triggering event. Usually, it's the latest commit, but in your case, it equals the Last commit on the branch or tag that received the dispatch
:
GitHub Actions - Workflow Dispatch
I think this might lead to the ref not existing in your action. As you observed, running actions/checkout
with fetch-depth: 0
fixes it by ensuring all Git refs are fetched during checkout.
I hope this sheds light! If you reencounter issues, let's revisit the investigation ππ».
from action-create-tag.
I improved the documentation (see #39).
from action-create-tag.
I improved the documentation (see #39).
Excellent! Hopefully, others will benefit from my missteps and your additional documentation.
from action-create-tag.
I improved the documentation (see #39).
Excellent! Hopefully, others will benefit from my missteps and your additional documentation.
Thank you for finding a use case which I did not think of and, by doing so, improving the action β€οΈβπ₯.
from action-create-tag.
Related Issues (20)
- Dependency Dashboard
- Unable to tag non main branch HOT 1
- [UPSTREAM_BUG] Error: fatal: not in a git directory HOT 19
- fatal: Failed to resolve 'commit-hash' as a valid ref. HOT 1
- Invalid username or password error when executed in different job than actions/checkout HOT 2
- Add support for Git LFS
- Replace spaces with underscore (or dash) HOT 2
- Support for Windows and Mac HOT 5
- Support for Mac HOT 1
- fatal: bad object type. issue in a reusable workflow HOT 1
- Input to indicate if the tag exists skip creation process HOT 3
- GITHUB_OUTPUT: parameter not set error HOT 3
- cannot lock ref 'refs/tags': Filename too long HOT 5
- `tag_exists_error: false` still errors if tag already exists on remote. HOT 4
- Please add instructions on how to add the GitHub token for authohorization to the example HOT 5
- [UPSTREAM_BUG] tags not being feteched in in checkout v4 HOT 2
- Can I used PATs for the GITHUB_TOKEN to create protected tags
- Sining with GPG is failing with error gpg: error reading key: No public key
- Ref to tag should be sha of workflow, not commit_sha
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from action-create-tag.