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

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

Open
bakoontz2 opened this issue Jun 22, 2024 · 0 comments
Open

Comments

@bakoontz2
Copy link

bakoontz2 commented Jun 22, 2024

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.

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