1

I'm using the same .travis.yml file (everything same except the defined values) between all my projects and they had been working for years.

Today I initiated a new project in Github (Go) and noticed that the default master branch is now named main. However, this switch breaks my travis-ci build. I'm getting

Skipping a deployment with the bintray provider because this branch is not permitted: main

I don't specific any branches in my .travis.yml file:

$ grep -i branch .travis.yml || echo not found
not found

How to fix it? Would adding branch specification in my .travis.yml within the following section fix the issue?

deploy:
  - provider: bintray
    user: myid
    key: ${BINTRAY_API_KEY}
    file: bintray-bin.json
    skip_cleanup: true

I'd better ask instead of triggering my travis-ci build over and over to find the correct solution.

xpt
  • 20,363
  • 37
  • 127
  • 216

1 Answers1

0

Late to answer but if someone face the same problem.

For a React deployment i just add branchers entry to specify the branch i want to deploy :

.travis.yml:

branches:
  only:
    - master
  except:
    - develop

the whole configuration looks like :

language: node_js
node_js:
  - "8"
cache: npm
branches:
  only:
    - master
  except:
    - develop
jobs:
  include:
    - stage: deploy
      script:
        - npm install -g firebase-tools
        - npm run build
        - firebase deploy --project "$projectId" --token "$FIREBASE_TOKEN"

Note : define the environment variables projectId and FIREBASE_TOKEN on the setting section on travis of the repo.

Look at this article

mhannani
  • 492
  • 1
  • 5
  • 18