sanctuarycomputer / sanctu-dot-com

The official Sanctuary Computer dot com
https://www.sanctuary.computer
4 stars 1 forks source link

Add tokens to fix vercel-action deployments triggered by Dependabot #188

Open mokaymokay opened 1 year ago

mokaymokay commented 1 year ago

We have Dependabot enabled to update dependencies, usually we can just merge these minor updates as they come up, but it seems like the previews are failing: https://github.com/sanctuarycomputer/sanctu-dot-com/actions/runs/4085007316/jobs/7042405703

We ran into the same issue with Hinge lately, basically it's due to Dependabot not having access to action secrets. This can be fixed by adding those same secrets to Dependabot secrets (option #2 listed in this comment)

You wouldn't need to see the Vercel tokens in the action secrets panel, so you'll need to generate new ones in Vercel here

This issue can be closed when:

nahbee10 commented 1 year ago

@mokaymokay This is solved by adding necessary tokens to dependabot and necessary github-token permissions to deploy workflow to solve this issue caused by github-token's read-only default permission(related doc)

Screen Shot 2023-02-14 at 1 31 46 PM

All dependabot PRs passed the checks! Should I merge them to main?

mokaymokay commented 1 year ago

hmm I don't think the issue is solved by adding the permissions to the deploy.yml. After we add secrets to Dependabot secrets, it should already have access.

The error says:

find comment
previous comment not found

So I think it's because there's no commit message? Bryan fixed a similar issue yesterday by adding a default commit message for Dependabot. https://github.com/sanctuarycomputer/hinge/commit/8da019f80e03a7da64df1b6776ebde4c04a193d9

I think the errors may be gone because we added the commit "Update deploy.yml"

nahbee10 commented 1 year ago

@mokaymokay thanks for the feedback on the issue!

❇️ Short conclusion: added fixed version of dependabot config(dependabot.yml), removed permissions:, but would like to wait until next dependabot action to verify if this solves the problem!

❇️ Long one: I think adding default commit message cannot solve the issue since,

mokaymokay commented 1 year ago

@nahbee10 Thanks for explaining about the Error: Resource not accessible by integration, I'm OK with us adding permissions, but can we just add the ones that Dependabot absolutely needs?

According to the docs, contents is for updating a file, which makes sense since it's trying to update version in package.json.

Can we double check the docs and only add the permissions that we need? TY!

mokaymokay commented 1 year ago

Good to merge the PRs btw, looks like none of them are major version updates~