secrets.GITHUB_TOKEN is not accepted in composer configuration


We have a Github action using secrets.GITHUB_TOKEN to add to composer configuration (see here), but this started to fail some days ago without any changes in our config.

Here’s the error:

  Your github oauth token for contains invalid characters: "***"  

The error message is coming from composer, so it means that composer does not accept (anymore) some characters of the Github token.

Is there something I am missing?
Is there a way to workaround this?

Thanks for the help!

GitHub changed the token format recently, maybe composer needs an update to adjust its validation to those changes? The GITHUB_TOKEN is freshly generated for the workflow, so it’d make sense for those changes to apply immediately.

Thanks for the hint @airtower-luna! I’ll create a ticket on the composer repo.

1 Like

This has been already addressed (here) and released 4 days ago in composer 2.0.12 and 1.10.21.

The GitHub runners have 2.0.11 installed, so that’s probably the problem: virtual-environments/ at 0d102a98d4cfceacb785d08ed185935b2654ff60 · actions/virtual-environments · GitHub

You could try creating an issue in that repo if there isn’t one already.

1 Like

Right @airtower-luna! Actually, there’s already a pre-release shipping with composer 2.0.12 on the way.

So I guess I just have to wait a bit. Thanks again for pointing me to the right direction :slight_smile:

1 Like