Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Remove octokit README updates for v7 #557

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

Merged
merged 1 commit into from
Feb 26, 2025
Merged

Conversation

joshmgross
Copy link
Member

#508 introduced a new octokit variable to make it easier to use examples from GitHub and Octokit docs within actions/github-script.

That change is a breaking change so the README updates shouldn't have been made with v7.

We'll update the README to include this info again when we're ready for v8 - #556

@joshmgross joshmgross requested a review from a team as a code owner February 26, 2025 19:42
@joshmgross joshmgross temporarily deployed to debug-integration-test February 26, 2025 19:42 — with GitHub Actions Inactive
Copy link

Hello from actions/github-script! (f048dc3)

@joshmgross joshmgross merged commit d0bdaba into main Feb 26, 2025
14 checks passed
@joshmgross joshmgross deleted the joshmgross/fix-readme-v7 branch February 26, 2025 19:46
@iamstarkov
Copy link
Contributor

I dont understand why #508 was a breaking change if it didnt remove any functionality and didnt change existing, it only added to the api surface. Can someone elaborate?

@joshmgross
Copy link
Member Author

I dont understand why #508 was a breaking change if it didnt remove any functionality and didnt change existing, it only added to the api surface. Can someone elaborate?

If users are defining a variable named octokit in their scripts (which I suspect some are), then these scripts would fail with the changes introduced by #508

For example:

      - uses: actions/github-script@main
        with:
          script: |
            const octokit = github
            await octokit.rest.issues.createComment({
              owner: context.repo.owner,
              repo: context.repo.repo,
              issue_number: ${{ github.event.issue.number }},
              body: "Hello Again!"
            })

https://github.com/joshmgross/actions-testing/blob/05cfb53de657306dbb637cb4b9820d527270cfd7/.github/workflows/comment-on-issue.yaml

That will fail with the error

Unhandled error: SyntaxError: Identifier 'octokit' has already been declared

https://github.com/joshmgross/actions-testing/actions/runs/13551951964

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.

3 participants