Auto: Upload Assets plugin: do not create Canary tag/prerelease when running in base branch

Created on 10 Feb 2021  Â·  1Comment  Â·  Source: intuit/auto

Describe the bug

When using the upload-assets plugin along with shipit, the plugin creates a canary tag and a Canary Assets pre-release when running on the CI (GitHub Action) in the base branch.

To Reproduce

Configure a GitHub action that calls auto shipit. Auto is configured to upload the foo.sh script as an additional release asset:

Content of .autorc:

{
  "plugins": [
    "git-tag",
    ["upload-assets", {"assets": ["./dist/bin/packages/tools/foo.sh"]}]
  ],
  "author": "Auto <auto>",
  "owner": "me",
  "repo": "my-repo",
  "shipit": {
    "prerelease": false,
    "noChangelog": true
  }
}

Content of the release-and-publish action:

name: 'Release and Publish'
runs:
  using: "composite"
  steps:
    - name: Release and Publish
      run: |
        if auto label --exists skip-release; then
            echo Found the skip-release label, release will be skipped!
        else
            auto shipit -v
        fi
      shell: bash

Expected behavior

When using the upload-assets plugin with shipit, it should not create a canary tag/prerelease when running in the base branch.

The plugin is generic and doesn't have knowledge that it's being invoked by/from shipit, adding an enableCanary a property to explicitly disable canaries would resolve the issue:

{
  "plugins": [
    [
      "upload-assets", {
          "assets": ["./dist/bin/packages/tools/foo.sh"],
          "enableCanary": "false"
      }
    ]
  ]
}

Screenshots

The two images below show that we have the "Canary Asserts" being created/updated every release, it was created by running auto shipit from the base branch:

image

image

This is how I found out about the Canary tag and asset: when enabling Auto in our repository the canary tag got picked up as the Current Version, the build failed because Auto was unable to compute the next version from the "non-semver" vcanary. Deleting the tag/release allowed us to fix the release, however we were surprised to see that tag reappear:

image

Environment information:

Ran auto info in a GitHub Action:

Run auto info
  auto info
  shell: /bin/bash -e {0}
  env:
    INTUIT_AUTO_URL: https://github.com/intuit/auto/releases/download/v10.13.3/auto-linux.gz
    GITHUB_TOKEN: ***

Environment Information:

"auto" version: v10.13.2
"git"  version: v2.30.0
"node" version: v12.18.1

Project Information:

✔ Repository:      REDACTED
✔ Author Name:     Auto
✔ Author Email:    auto
✔ Current Version: v4.2.0
✔ Latest Release:  v4.2.0 (​https://github.com/REDACTED/REDACTED/releases/tag/v4.2.0​)

✔ Labels configured on GitHub project 

GitHub Token Information:

✔ Token:            [Token starting with v1.f]
✖ Repo Permission:  none
✖ User:             undefined
✔ API:              undefined (​undefined​)
✖ Enabled Scopes:   undefined
✔ Rate Limit:       996/1000

Additional context


Keep up the good work!

bug released

Most helpful comment


:rocket: Issue was released in v10.16.3 :rocket:

>All comments


:rocket: Issue was released in v10.16.3 :rocket:

Was this page helpful?
0 / 5 - 0 ratings