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

Fix Actions error create-update-branch #303

Closed
Tracked by #256
Irratzo opened this issue Jun 13, 2024 · 3 comments
Closed
Tracked by #256

Fix Actions error create-update-branch #303

Irratzo opened this issue Jun 13, 2024 · 3 comments
Labels
configuration Issue refers to the best-of list configuration

Comments

@Irratzo
Copy link
Member

Irratzo commented Jun 13, 2024

Configuration Change:

Beginning 2024-06-13, the update-best-of-list workflow has failed repeatedly (example failed runs, if not deleted: 1, 2).

The error occurs in the step create-update-branch. The error message is this.

Run peterjgrainger/action-create-branch@v2.0.1
  with:
    branch: update/2024.06.13-08.19
  env:
    BRANCH_PREFIX: update/
    DEFAULT_BRANCH: main
    VERSION: 2024.06.13-08.19
    GITHUB_TOKEN: ***
Error: HttpError: Branch not found

The workflow also shows two warnings, up to this step.

Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v2, peterjgrainger/action-create-branch@v2.0.1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, peterjgrainger/action-create-branch@v2.0.1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/

This is a critical error. The list README cannot be generated anymore. Manual branch creation and then run the workflow is not fail-safe.

So, need to fix the error.

@Irratzo Irratzo added the configuration Issue refers to the best-of list configuration label Jun 13, 2024
@Irratzo Irratzo mentioned this issue Jun 13, 2024
13 tasks
@Irratzo
Copy link
Member Author

Irratzo commented Jun 13, 2024

Solution attempt 1.

Try fixing the error by fixing the mentioned workflow warning 1.

Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v2, peterjgrainger/action-create-branch@v2.0.1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

First, locate the Actions code in this repo that uses actions/checkout@v2 and peterjgrainger/action-create-branch@v2.0.1.

The Actions code is in update-best-of-list.yml. URL, permalink. For actions/checkout@v2, L27, L39, for peterjgrainger/action-create-branch@v2.0.1 (the one that creates the fail error), L34.

Let's compare to the best-of lists root repo, best-of. There, the same action versions are still used in the update-best-of-list-yml (permalink). Indeed, that file there hasn't been changed since 3 years, and a recent update run there (example) prints the same warning. But the error that I observe here does not occur, which is strange. In the corresponding best-of-generator template repo, I was not able to find the corresponding code location.

Anyway, let's first attempt to fix this in my repo here. If it works, I can create a PR in the best-of repo. Since it seems to be stale (see stale issues), unlikely that the devs will pick it up, but it would be the correct thing to do. I wonder how the proper way to do it, ie, get the PR merged there, then get the fix there into my repo by updating upstream or something like that. But, let's ignore that idea.

Okay, let's find the repos of the corresponding action, to find the correct new versions.

So, let's try that. Just replace the action versions in this repo's file update-best-of-list.yml with those versions.

  • actions/checkout@v2 --> actions/checkout@v4
  • peterjgrainger/action-create-branch@v2.0.1 --> peterjgrainger/action-create-branch@v3

@Irratzo
Copy link
Member Author

Irratzo commented Jun 13, 2024

Okay it failed with error "Unable to resolve action peterjgrainger/action-create-branch@v3, unable to find version v3". Indeed, the full version identifier is "v3.0.0". So, let's try that instead.

  • peterjgrainger/action-create-branch@v3 --> peterjgrainger/action-create-branch@v3.0.0

@Irratzo
Copy link
Member Author

Irratzo commented Jun 13, 2024

Nice, it worked.

I have asked the best-of maintainers to fix this issue upstream, as well. Let's hope they still are active.

Issue closed.

@Irratzo Irratzo closed this as completed Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration Issue refers to the best-of list configuration
Projects
None yet
Development

No branches or pull requests

1 participant