Skip to content

[Bug] Sync-upstream workflow fails due to Octokit redeclaration in github-script #583

@Salmaan-M

Description

@Salmaan-M

Bug Description

The GitHub Actions workflow .github/workflows/sync-upstream.yml fails because it redeclares an Octokit/GitHub client inside actions/github-script, even though the action already provides a pre-authenticated github client in the script context. This causes a syntax/runtime error and prevents the workflow from completing successfully.

Steps to Reproduce

Steps to reproduce the behavior:
1.Open the fossasia/scrum_helper repository.
2.Go to .github/workflows/sync-upstream.yml and run the workflow manually from the Actions tab, or wait for the scheduled run.
3.Open the failed workflow logs.
4.Observe the error: Unhandled error: SyntaxError: Identifier 'octokit' has already been declared

Expected Behavior

The workflow should use the built-in github client provided by actions/github-script and complete the fork sync process without throwing a redeclaration error

Actual Behavior

The workflow fails during execution because the script manually creates or redeclares an Octokit/GitHub client inside actions/github-script, which conflicts with the already available client in the workflow runtime.

Screenshots

The failed workflow run page
Image

Image

Additional Context

A tested fix is to remove the manual Octokit initialization and use the built-in github.rest... client from actions/github-script instead. Updating from actions/github-script@v7 to a newer supported version such as v8 also helps avoid the Node.js deprecation warning.


Contribution Checklist

  • I have searched existing issues to ensure this bug hasn't been reported
  • I have provided clear reproduction steps
  • I have included relevant environment details
  • I have described both expected and actual behavior

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions