Skip to content

Remove octokit README updates for v7 - #557

Merged
joshmgross merged 1 commit into
mainfrom
joshmgross/fix-readme-v7
Feb 26, 2025
Merged

Remove octokit README updates for v7#557
joshmgross merged 1 commit into
mainfrom
joshmgross/fix-readme-v7

Conversation

@joshmgross

Copy link
Copy Markdown
Contributor

#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
@github-actions

Copy link
Copy Markdown

Hello from actions/github-script! (f048dc3)

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

Copy link
Copy Markdown
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
Copy Markdown
Contributor 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

3 participants