Skip to content

Action tries to set tag for deleted repo when used in reusable workflow #49

@bakoontz2

Description

@bakoontz2

Describe the bug
If an action is called as part of a reusable workflow, and that action attempts to create a tag, the repo of the calling action is acted upon, even though it's clearly been deleted by checkout.

Here's an example. This action is in a repo called SP_CAL-transform:

    - uses: actions/checkout@v4
      with:
        fetch-depth: 0
        repository: <internal>/SP_CAL-transform
        ref: ${{ inputs.deployBranch }}
        show-progress: 'false'
        token: ${{ env.GITHUB_PAT }}

    - name: Build, dockerize and push to artifactory
       run: <do some stuff>

     - name: Get workspace sha
      run: |
        echo "WORKSPACE_SHA=$(/usr/bin/git log -1 --format='%H')" >> $GITHUB_ENV

    - name: Tag the commit with the version
      uses: rickstaa/action-create-tag@v1
      with:
        tag: ${{ env.DEPLOY_VERSION }}
        commit_sha: ${{ env.WORKSPACE_SHA }}

Assume this is called from a workflow in the SP_sched_core repo.

In the Run actions/checkout@4 logs, the SP_sched_core repo is deleted, and the SP_CAL-transform repo is checked out:

Deleting the contents of '/home/runner/work/SP_sched_core/SP_sched_core'
...
Fetching the repository
From https://github.com/AAInternal/SP_CAL-transform
...

But when the action-create-tag is executed, it tries to push to the non-existent SP_sched_core:

[action-update-semver] Setup git user name and email.
[action-create-tag] Create tag '1.0.20240622204500'.
[action-create-tag] Push tag '1.0.20240622204500'
To https://github.com/<internal>/SP_sched_core.git

To Reproduce
See above.

Expected behavior
I would expect the action-create-tag action to push the tag to the most-recently checked-out repository, not to the original repo from where the action is originally called.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions