Skip to content
Open
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f2f7f58
ci: Use github/setup-licensed
nschonni Jun 3, 2024
fd2cfc1
ci: pin ruby/setup-ruby
nschonni Jun 10, 2024
19e58d8
Define `permissions` in workflows and update actions
joshmgross Jan 28, 2025
8e643f1
chore: Add Dependabot for .github/actions/install-dependencies
nschonni Jan 28, 2025
ac230a1
chore: Remove .vscode settings
nschonni Jan 28, 2025
08caadd
Merge pull request #531 from actions/joshmgross/update-workflows
joshmgross Jan 29, 2025
6efc757
Merge branch 'main' into sub-action-dependabot
joshmgross Jan 29, 2025
eef4fd9
Merge branch 'main' into remove-vscode
joshmgross Jan 29, 2025
eb88965
Merge pull request #532 from nschonni/sub-action-dependabot
joshmgross Jan 29, 2025
511abaa
Merge branch 'main' into remove-vscode
joshmgross Jan 29, 2025
8cf50d1
Merge pull request #533 from nschonni/remove-vscode
joshmgross Jan 29, 2025
586a6a1
Merge branch 'main' into upstream-setup-license
joshmgross Jan 29, 2025
91a83c0
Merge pull request #473 from nschonni/upstream-setup-license
joshmgross Jan 29, 2025
4024541
make octokit instance available as octokit on top of github, to make …
iamstarkov Jan 15, 2025
f23cd47
replace GitHub with octokit in the README, but keep a note of the Git…
iamstarkov Jan 31, 2025
6320504
fix: adjust types
iamstarkov Jan 31, 2025
378a50f
Merge pull request #508 from iamstarkov/patch-2
joshmgross Feb 4, 2025
86ac137
docs: add "exec" usage examples
neilime Feb 17, 2025
851500a
Remove `octokit` README updates for v7
joshmgross Feb 26, 2025
d0bdaba
Merge pull request #557 from actions/joshmgross/fix-readme-v7
joshmgross Feb 26, 2025
ea54302
Merge branch 'actions:main' into patch-1
neilime Mar 4, 2025
62c3794
Merge pull request #546 from neilime/patch-1
joshmgross Mar 5, 2025
14b73c4
Bump ruby/setup-ruby from 1.213.0 to 1.222.0
dependabot[bot] Mar 10, 2025
3908079
Merge pull request #563 from actions/dependabot/github_actions/ruby/s…
joshmgross Mar 10, 2025
5b5837a
Bump ruby/setup-ruby from 1.222.0 to 1.229.0
dependabot[bot] Mar 31, 2025
e7aeb8c
Merge pull request #575 from actions/dependabot/github_actions/ruby/s…
joshmgross Apr 2, 2025
f9d8109
Clearly document passing inputs to the `script`
joshmgross May 13, 2025
3424b52
typo fixes
joshmgross May 13, 2025
5ee2b97
Merge pull request #603 from actions/joshmgross/document-inputs
joshmgross May 14, 2025
1ae9958
Update README.md
nebuk89 Jun 2, 2025
f28e40c
Merge pull request #610 from actions/nebuk89-patch-1
nebuk89 Jun 6, 2025
2c81ba0
Update Node.js version support to 24.x
salmanmkc Jul 29, 2025
e7b7f22
update licenses
salmanmkc Aug 8, 2025
20fe497
Merge pull request #637 from actions/node24
salmanmkc Sep 4, 2025
adc0eea
README for updating actions/github-script from v7 to v8
sneha-krip Sep 4, 2025
8b222ac
Apply suggestion from @salmanmkc
sneha-krip Sep 4, 2025
01e118c
Update README for Node 24 runtime requirements
sneha-krip Sep 4, 2025
2dc352e
Bold minimum Actions Runner version in README
sneha-krip Sep 4, 2025
ed59741
Merge pull request #653 from actions/sneha-krip/readme-for-v8
sneha-krip Sep 4, 2025
e6664bd
git script
granjacours410-source Nov 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove octokit README updates for v7
  • Loading branch information
joshmgross committed Feb 26, 2025
commit 851500a2ad074568533e96b6a6779c2b00873d2e
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ uses the GitHub API and the workflow run context.
To use this action, provide an input named `script` that contains the body of an asynchronous JavaScript function call.
The following arguments will be provided:

- `octokit` (and `github`) A pre-authenticated
[octokit/rest.js](https://octokit.github.io/rest.js) client _instance_ with pagination plugins
- `github` A pre-authenticated
[octokit/rest.js](https://octokit.github.io/rest.js) client with pagination plugins
- `context` An object containing the [context of the workflow
run](https://github.com/actions/toolkit/blob/main/packages/github/src/context.ts)
- `core` A reference to the [@actions/core](https://github.com/actions/toolkit/tree/main/packages/core) package
Expand Down Expand Up @@ -102,14 +102,14 @@ By default, requests made with the `github` instance will not be retried. You ca
result-encoding: string
retries: 3
script: |
octokit.rest.issues.get({
github.rest.issues.get({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
})
```

In this example, request failures from `octokit.rest.issues.get()` will be retried up to 3 times.
In this example, request failures from `github.rest.issues.get()` will be retried up to 3 times.

You can also configure which status codes should be exempt from retries via the `retry-exempt-status-codes` option:

Expand All @@ -121,7 +121,7 @@ You can also configure which status codes should be exempt from retries via the
retries: 3
retry-exempt-status-codes: 400,401
script: |
octokit.rest.issues.get({
github.rest.issues.get({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down Expand Up @@ -162,7 +162,7 @@ jobs:
- uses: actions/github-script@v7
with:
script: |
octokit.rest.issues.createComment({
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
Expand All @@ -184,7 +184,7 @@ jobs:
- uses: actions/github-script@v7
with:
script: |
octokit.rest.issues.addLabels({
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
Expand All @@ -209,12 +209,12 @@ jobs:
// Get a list of all issues created by the PR opener
// See: https://octokit.github.io/rest.js/#pagination
const creator = context.payload.sender.login
const opts = octokit.rest.issues.listForRepo.endpoint.merge({
const opts = github.rest.issues.listForRepo.endpoint.merge({
...context.issue,
creator,
state: 'all'
})
const issues = await octokit.paginate(opts)
const issues = await github.paginate(opts)

for (const issue of issues) {
if (issue.number === context.issue.number) {
Expand All @@ -226,7 +226,7 @@ jobs:
}
}

await octokit.rest.issues.createComment({
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
Expand All @@ -252,7 +252,7 @@ jobs:
with:
script: |
const diff_url = context.payload.pull_request.diff_url
const result = await octokit.request(diff_url)
const result = await github.request(diff_url)
console.log(result)
```

Expand Down Expand Up @@ -289,7 +289,7 @@ jobs:
name: context.repo.repo,
label: 'wontfix'
}
const result = await octokit.graphql(query, variables)
const result = await github.graphql(query, variables)
console.log(result)
```

Expand All @@ -310,13 +310,13 @@ jobs:
with:
script: |
const script = require('./path/to/script.js')
console.log(script({octokit, context}))
console.log(script({github, context}))
```

And then export a function from your module:

```javascript
module.exports = ({octokit, context}) => {
module.exports = ({github, context}) => {
return context.payload.client_payload.value
}
```
Expand Down Expand Up @@ -350,15 +350,15 @@ jobs:
with:
script: |
const script = require('./path/to/script.js')
await script({octokit, context, core})
await script({github, context, core})
```

And then export an async function from your module:

```javascript
module.exports = async ({octokit, context, core}) => {
module.exports = async ({github, context, core}) => {
const {SHA} = process.env
const commit = await octokit.rest.repos.getCommit({
const commit = await github.rest.repos.getCommit({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `${SHA}`
Expand Down Expand Up @@ -487,7 +487,7 @@ jobs:
with:
github-token: ${{ secrets.MY_PAT }}
script: |
octokit.rest.issues.addLabels({
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down