Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.

Tags point at wrong commit #31

Closed
fleskesvor opened this issue Dec 28, 2019 · 5 comments
Closed

Tags point at wrong commit #31

fleskesvor opened this issue Dec 28, 2019 · 5 comments

Comments

@fleskesvor
Copy link
Contributor

My use-case is that I need to create release assets for every commit, across all branches, so this action seems ideal. However, when using it on branches, I've noticed that every tag ends up pointing at master HEAD, even though I've verified in an earlier step that the commit checked out by actions/checkout@v1 is in fact pointing at a commit on my branch.

Additionally, I'm trying to set the body to github.event.commits[0].message, and according to the output from the job, it is set to the correct commit message, but when I look at the list of releases in my repo, it has somehow been set to the commit message of master HEAD instead.

My pipeline looks like this:

    steps:
      - uses: actions/checkout@v1
      - id: artifact-version
        uses: fleskesvor/actions-test/actions/create-artifact-version@master
      - name: Test artifact version
        run: |
          echo "VERSION: ${VERSION}"
          echo "COMMIT MESSAGE: ${MESSAGE}"
          git log -1
        env:
          VERSION: ${{ steps.artifact-version.outputs.version }}
          MESSAGE: ${{ github.event.commits[0].message }}
      - id: github-release
        uses: actions/create-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: ${{ steps.artifact-version.outputs.version }}
          release_name: ${{ steps.artifact-version.outputs.version }}
          body: ${{ github.event.commits[0].message }}

Where fleskesvor/actions-test/actions/create-artifact-version@master is just a crude, custom made action to set a version/tag on a specific format.

@fleskesvor
Copy link
Contributor Author

After looking into the code, I realized that the issue is that this action calls octokit.repos.createRelease() without a target_commitish, which makes the API default to the repository's default branch (usually master). I created #32 to set target_commitish with what I think is a more reasonable default in the context of a CI workflow.

@nathany
Copy link

nathany commented Jan 15, 2020

I'm seeing this issue too. I'm testing create release on a branch initially. In practice I'll probably always create releases from the default master branch, but it's odd that it doesn't adhere to the branch where the build is running.

@RadWolfie
Copy link

I too am seeing this issue. It would be great to enforce create a (pre-)release base on specific commit it was built from.

We have 16 pre-release builds, only 3 of them has been tagged to wrong release's commit.

@rach1416
Copy link

I am seeing this issue too where the release is targeting the latest commit on the master branch not the latest commit on the dev-branch

@mscoutermarsh
Copy link
Contributor

Thanks all, this is merged. See: #32 (comment)

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

No branches or pull requests

5 participants