Skip to content

Conversation

joergmis
Copy link

Hey there! I was looking for something like this and updated the versions since they were a bit out of date 😉

  • update cypress to 12.13.0
  • switch to v6 API of vercel
  • add optional parameters that are passed to Cypress
  • update the readme with more details and a check

@mikefrancis
Copy link
Owner

Hey @joergmis, thanks for the PR. Is the team bit now required? Or is this just if you are on a team plan?

@joergmis
Copy link
Author

joergmis commented Jun 24, 2023

Hey @mikefrancis I looked into it and teamId is not required unless you actually want to access something from a team. You can test this with a token with the scope "Full Account":

# list deployments from your account
curl -X GET "https://api.vercel.com/v6/deployments" -H "Authorization: Bearer ${TOKEN}"

# list deployments from a specific project (from your account)
curl -X GET "https://api.vercel.com/v6/deployments?projectId=${PROJECT_ID}" -H "Authorization: Bearer ${TOKEN}"

# list deployments from a team
curl -X GET "https://api.vercel.com/v6/deployments?teamId=${TEAM_ID}" -H "Authorization: Bearer ${TOKEN}"

# list deployments from a specific project (from a team)
curl -X GET "https://api.vercel.com/v6/deployments?teamId=${TEAM_ID}&projectId=${PROJECT_ID}" -H "Authorization: Bearer ${TOKEN}"

I added two commits which add:

  • the project ID as a required parameter
  • the team ID as an optional parameter

This way I think it should still work for both teams and non-teams. The projectId is not necessarily required but I think it would make sense to make sure you get the right deployments in case you work on multiple projects simultaneously.

The projectId would be a breaking change but since the cypress version is updated quite a bit I guess it would make sense to mark it (at least) as a minor update anyway. What do you think?

@matiascaputti
Copy link

Good work @joergmis, would it make sense to upgrade directly to version 13?

@mikefrancis what else is needed to be able to merge the PR?

@joergmis
Copy link
Author

joergmis commented Dec 2, 2023

Good point @matiascaputti! I updated the version and tested my forked action (full example at Startup-Nights/website#133):

      - uses: joergmis/vercel-cypress@main
        with:
          vercel-token: ${{ secrets.VERCEL_SECRET }}
          project-id: ${{ secrets.VERCEL_PROJECT_ID }}
          team-id: ${{ secrets.VERCEL_TEAM_ID }}
          options: "--browser chrome --spec cypress/e2e/*"

There was an issue in the entrypoint script - not sure why this wasn't an issue previously but anyway, it works again 😄

@live-alchemy
Copy link

I tried running this action but also saw an issue with firing up Docker. Is this the error you saw @joergmis ?

 ------
   > [2/3] RUN apt-get update && apt-get install -y curl jq:
  0.677   404  Not Found
  0.685 Ign:12 http://deb.debian.org/debian stretch-updates/main all Packages
  0.689 Reading package lists...
  0.704 W: The repository 'http://deb.debian.org/debian stretch Release' does not have a Release file.
  0.704 W: The repository 'http://deb.debian.org/debian stretch-updates Release' does not have a Release file.
  0.704 W: The repository 'http://security.debian.org/debian-security stretch/updates Release' does not have a Release file.
  0.704 E: Failed to fetch http://deb.debian.org/debian/dists/stretch/main/binary-amd64/Packages  404  Not Found
  0.704 E: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/main/binary-amd64/Packages  404  Not Found
  0.704 E: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/main/binary-amd64/Packages  404  Not Found
  0.704 E: Some index files failed to download. They have been ignored, or old ones used instead.
  ------
  Dockerfile:4
  --------------------
     2 |     
     3 |     # https://docs.cypress.io/guides/continuous-integration/introduction#Machine-requirements
     4 | >>> RUN apt-get update && apt-get install -y curl jq
     5 |     
     6 |     # Copies your code file from your action repository to the filesystem path `/` of the container
  --------------------
  ERROR: failed to solve: process "/bin/sh -c apt-get update && apt-get install -y curl jq" did not complete successfully: exit code: 100
Error: Docker build failed with exit code 1

@joergmis
Copy link
Author

@live-alchemy the issue I saw was in the entrypoint script.

Try rerunning the workflow. This is most likely just a temporary issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants