magefile / mage-action

GitHub Action for Mage
https://github.com/marketplace/actions/mage-action
MIT License
33 stars 7 forks source link

Error: Cannot find Mage latest release #267

Closed cep21 closed 1 year ago

cep21 commented 1 year ago

If I check out this repository and run yarn test I get failures matching the release target. This also happens when running the action against github for our repositories. This appears to be a new thing: maybe an hour old?

 FAIL  __tests__/github.test.ts
  github
    ✕ returns latest Mage GitHub release (675 ms)
    ✕ returns v1.8.0 Mage GitHub release (472 ms)

  ● github › returns latest Mage GitHub release

    expect(received).not.toBeNull()

    Received: null

       5 |   it('returns latest Mage GitHub release', async () => {
       6 |     const release = await github.getRelease('latest');
    >  7 |     expect(release).not.toBeNull();
         |                         ^
       8 |     expect(release?.tag_name).not.toEqual('');
       9 |   });
      10 |

      at __tests__/github.test.ts:7:25
      at fulfilled (__tests__/github.test.ts:28:58)

  ● github › returns v1.8.0 Mage GitHub release

    expect(received).not.toBeNull()

    Received: null

      11 |   it('returns v1.8.0 Mage GitHub release', async () => {
      12 |     const release = await github.getRelease('v1.8.0');
    > 13 |     expect(release).not.toBeNull();
         |                         ^
      14 |     expect(release?.tag_name).toEqual('v1.8.0');
      15 |   });
      16 | });

      at __tests__/github.test.ts:13:25
      at fulfilled (__tests__/github.test.ts:28:58)

--------------|---------|----------|---------|---------|-------------------
File          | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
--------------|---------|----------|---------|---------|-------------------
All files     |   48.78 |     6.67 |      75 |   46.15 |                   
 github.ts    |     100 |      100 |     100 |     100 |                   
 installer.ts |   38.24 |     6.67 |      50 |   38.24 | 16-45,49-52       
--------------|---------|----------|---------|---------|-------------------
cep21 commented 1 year ago

It's possible you want to use curl -H "Accept: application/json" https://api.github.com/repos/magefile/mage/releases/latest instead of curl -H "Accept: application/json" https://github.com/magefile/mage/releases/latest at https://github.com/magefile/mage-action/blob/2c1951143e54356ebe6a0c6c971bae325b5b50f1/src/github.ts#L9

crazy-max commented 1 year ago

See https://github.com/docker/setup-buildx-action/issues/190#issuecomment-1407187953

GitHub API sad :persevere:

sheimi commented 1 year ago

created a PR to mitigate this issue by using Github Action API: https://github.com/magefile/mage-action/pull/268