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

actions: write updates directly to redirectLinks.json to main #85

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

flakey5
Copy link
Member

@flakey5 flakey5 commented Nov 19, 2023

Closes #66

@flakey5 flakey5 requested a review from a team as a code owner November 19, 2023 19:29
@flakey5 flakey5 merged commit 830d72a into main Nov 20, 2023
3 checks passed
@flakey5 flakey5 deleted the flakey5/66 branch November 20, 2023 17:12
@flakey5
Copy link
Member Author

flakey5 commented Nov 20, 2023

The deploy step is failing https://github.com/nodejs/release-cloudflare-worker/actions/runs/6933469355/job/18859682904, I assumed secrets.GH_USER_TOKEN would work automatically but that looks to not be the case. How can we go about adding it

@MoLow
Copy link
Member

MoLow commented Nov 23, 2023

Is my help needed here? I can add a token if still needed

@ovflowd
Copy link
Member

ovflowd commented Nov 23, 2023

The deploy step is failing nodejs/release-cloudflare-worker/actions/runs/6933469355/job/18859682904, I assumed secrets.GH_USER_TOKEN would work automatically but that looks to not be the case. How can we go about adding it

You can simply just add the example mentioned there. But in general, these should be triggered on the "behalf" of an user. Adding the default token there might give an error that this Token has no access to this resource. Pretty much because GitHub Actions Tokens have access/scope only for that specific GitHub Workflow and Run.

@targos
Copy link
Member

targos commented Nov 23, 2023

GH_USER_TOKEN is not the token generated by GitHub actions. If you want to use that one, it's GITHUB_TOKEN

@ovflowd
Copy link
Member

ovflowd commented Nov 23, 2023

GH_USER_TOKEN is not the token generated by GitHub actions. If you want to use that one, it's GITHUB_TOKEN

Right, yes. We need to pretty much then provide an user token.

@MoLow
Copy link
Member

MoLow commented Nov 23, 2023

The workflow did not fail due to credentials, it failed because main is a protectd branch:

https://github.com/nodejs/release-cloudflare-worker/actions/runs/6964068075/job/18950729144#step:6:40

remote: error: GH006: Protected branch update failed for refs/heads/main.
remote: error: Changes must be made through a pull request. 3 of 3 required status checks are expected.

@ovflowd
Copy link
Member

ovflowd commented Nov 23, 2023

The workflow did not fail due to credentials, it failed because main is a protectd branch:

https://github.com/nodejs/release-cloudflare-worker/actions/runs/6964068075/job/18950729144#step:6:40

remote: error: GH006: Protected branch update failed for refs/heads/main.

remote: error: Changes must be made through a pull request. 3 of 3 required status checks are expected.

Huh? Interesting. We could bypass the rule for github actions (user I think?)

@MoLow
Copy link
Member

MoLow commented Nov 23, 2023

yes, I am looking into this now

@targos
Copy link
Member

targos commented Nov 23, 2023

I suggest to work with pull requests, even for automation. You can enable auto-merge in the repo settings and do something like this in a workflow (assuming token with enough permissions):

          # somehow create a branch and commit
          gh pr create --title "title" --body ""
          gh pr merge --auto --squash

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.

Automatically merge & deploy prs for updating redirect links
4 participants