Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nur-{combined,search} repos not updating - 403 (token/permission issue?) #847

Closed
Rhys-T opened this issue Feb 20, 2025 · 10 comments
Closed

Comments

@Rhys-T
Copy link
Contributor

Rhys-T commented Feb 20, 2025

Neither nur-combined nor nur-search has received a commit since 2/10/2025, despite this main repo being continuously updated. It looks like the ad-m/github-push-action steps for update_combined and update_search are getting 403 Forbidden errors when trying to push to GitHub. It seems to either not like the token it's getting, or not think that token has the right permissions. Possibly something to do with the switch to peter-murray/workflow-application-token-action starting in 3979c65? I can't see anything more specific about the errors from what's in those logs, though.

@Pandapip1
Copy link
Collaborator

The weird thing is that I switched to the old PAT that was used for the original action in f2ae4c0 (${{ secrets.API_TOKEN_GITHUB }} rather than ${{ steps.get_workflow_token.outputs.token }}) and yet it still fails. Unfortunately, I got swamped with midterms and problem sets right after I started the transition, which is why I haven't fixed this yet. However, it seems that the action wants to try to push as github-actions[bot] despite this (I believe) being a user PAT.

@Rhys-T
Copy link
Contributor Author

Rhys-T commented Feb 21, 2025

Possibly relevant: ad-m/github-push-action#52
Early comments there suggest that the actions/checkout step is adding a setting to the git config that messes up the push authentication. The checkout action's post step does clean up that setting, but that only happens after the push has already been attempted. Someone in that thread pointed to ad-m/github-push-action#44 (comment), which suggests adding persist-credentials: false to the checkout step as a solution (along with fetch-depth: 0, but you already have that).

There were also people saying to add permissions: write-all to the workflow, but I wouldn't think that would be relevant if you're using the app token.

@Pandapip1
Copy link
Collaborator

Resolved by putting the update workflows in the repositories the workflows update. I don't know why it kept on trying to log in at github-actions[bot]. It very well may be still doing that, but the system works now, so I'm closing this.

@Rhys-T
Copy link
Contributor Author

Rhys-T commented Mar 2, 2025

Hmm… it's updating the main branches of both repos okay now, but it doesn't look like the gh-pages branch that actually runs the NUR site is getting rebuilt and updated yet.

I see the make command that builds the pages was removed from ci/update-nur-search.sh in 1867eb5 - what should be running it instead?

@Pandapip1
Copy link
Collaborator

Good catch -- I'll fix that right now.

@Rhys-T
Copy link
Contributor Author

Rhys-T commented Mar 2, 2025

The old version of the command used nix-shell to pull in Hugo, instead of installing a .deb:

nix-shell --run "make clean && make && make publish"
Would it be worth changing back to that?

(The make publish part can probably go away since you're using actions/upload-pages-artifact. Not sure whether the make clean is important or not.)

Edit: Ah, I guess that's what the # TODO: Use nix / flakes is about. Never mind.

@Rhys-T
Copy link
Contributor Author

Rhys-T commented Mar 2, 2025

@Pandapip1

It looks like the deploy_website job is failing now - either not getting a token, or not getting one with enough permissions. I don't know whether it needs to go through peter-murray/workflow-application-token-action or the builtin token stuff.

However, before fixing that, there's also a problem with the update_website job - it's not actually generating any web pages! I noticed in the output from Hugo that it only showed 7 pages, and sure enough, when I downloaded the artifact, there were no HTML files - just a few RSS and other XML files. My guess is that the checkout step needs to have submodules: true added to its with: section, to make sure the theme files get checked out as well.

@Pandapip1
Copy link
Collaborator

Thanks! I'll try to fix this now. I had some stuff I had to do.

@Rhys-T
Copy link
Contributor Author

Rhys-T commented Mar 2, 2025

As far as I can tell so far, the site seems to be working correctly now. Thanks!

(At first I thought there was a problem, since my repo disappeared from the site entirely, but on closer examination of the update_search logs, it turned out that I had messed something up on my end, and one of my packages' meta.homepage wasn't evaluating properly - it was being inherited from the wrong thing. I've pushed the fix to my repo and will check on it tomorrow. Edit: Yep, that's all it was.)

@Pandapip1
Copy link
Collaborator

Yea, I'll see how feasible implementing #376 is.

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

No branches or pull requests

2 participants