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

fatal: bad object type. issue in a reusable workflow #28

Closed
dtcMLOps opened this issue Dec 15, 2022 · 1 comment
Closed

fatal: bad object type. issue in a reusable workflow #28

dtcMLOps opened this issue Dec 15, 2022 · 1 comment

Comments

@dtcMLOps
Copy link

dtcMLOps commented Dec 15, 2022

Describe the bug
It seems there is an error when creating a new tag from a reusable workflow. If the tag that not exists, then it fails, but if the tag already exists, so it works as expected.

To Reproduce

#version.yml
name: "Versioning Reusable"

on:
  workflow_call:

jobs:
  versioning_generator:
    runs-on: ubuntu-22.04
    name: Sem Version Generator

    steps:
      # clones the current repository
      - name: Checkout current repository
        uses: actions/checkout@v3
        with:
          ref: ${{ github.head_ref }} # checkout the correct branch name
          fetch-depth: 0 # fetch the whole repo history

      # release tag version on repository
      - name: Tag Release
        uses: rickstaa/action-create-tag@v1.5.0
        with:
          tag: "api_fronten2/v0.1.2"
          message: "Releasing version myapp/v0.1.0"
# test_version.yml
name: Test Versioning

on:
  pull_request:
    branches:
      - main
    types: [opened, reopened, synchronize]

jobs:

  versioning:
    name: VER
    uses: ./.github/workflows/version.yml

Expected behavior
release a tag from a reusable workflow

Additional context

Run rickstaa/action-create-tag@v1.5.0
  with:
    tag: api_fronten[2](https://github.com/dtcMLOps/test-github-action/actions/runs/3707243389/jobs/6283418934#step:6:2)/v0.1.2
    message: Releasing version api_fronten2/v0.1.2
    github_token: ***
    force_push_tag: false
    no_verify_tag: false
/usr/bin/docker run --name d0a550951962426eb[3](https://github.com/dtcMLOps/test-github-action/actions/runs/3707243389/jobs/6283418934#step:6:3)7077[4](https://github.com/dtcMLOps/test-github-action/actions/runs/3707243389/jobs/6283418934#step:6:4)e2932cb[5](https://github.com/dtcMLOps/test-github-action/actions/runs/3707243389/jobs/6283418934#step:6:5)[6](https://github.com/dtcMLOps/test-github-action/actions/runs/3707243389/jobs/6283418934#step:6:6)_bfc[7](https://github.com/dtcMLOps/test-github-action/actions/runs/3707243389/jobs/6283418934#step:6:7)[8](https://github.com/dtcMLOps/test-github-action/actions/runs/3707243389/jobs/6283418934#step:6:9)f --label 2[9](https://github.com/dtcMLOps/test-github-action/actions/runs/3707243389/jobs/6283418934#step:6:10)0506 --workdir /github/workspace --rm -e "INPUT_TAG" -e "INPUT_MESSAGE" -e "INPUT_GITHUB_TOKEN" -e "INPUT_COMMIT_SHA" -e "INPUT_FORCE_PUSH_TAG" -e "INPUT_NO_VERIFY_TAG" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/test-github-action/test-github-action":"/github/workspace" 290506:d0a550951962426eb370774e2932cb56
fatal: bad object type.
[action-create-tag] Create tag 'api_fronten2/v0.1.2'.
@dtcMLOps
Copy link
Author

dtcMLOps commented Dec 15, 2022

I found out what was the problem. After I removed the ref: ${{ github.head_ref }} in the checkout, it is working now in a reusable workflow

- name: Checkout current repository
  uses: actions/checkout@v3
  with:
     fetch-depth: 0 # fetch the whole repo history

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant