Coder Social home page Coder Social logo

github-script's Introduction

actions/github-script

.github/workflows/integration.yml .github/workflows/ci.yml .github/workflows/licensed.yml

This action makes it easy to quickly write a script in your workflow that 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 function call. The following arguments will be provided:

  • github A pre-authenticated octokit/rest.js client with pagination plugins
  • context An object containing the context of the workflow run
  • core A reference to the @actions/core package
  • glob A reference to the @actions/glob package
  • io A reference to the @actions/io package
  • exec A reference to the @actions/exec package
  • require A proxy wrapper around the normal Node.js require to enable requiring relative paths (relative to the current working directory) and requiring npm packages installed in the current working directory. If for some reason you need the non-wrapped require, there is an escape hatch available: __original_require__ is the original value of require without our wrapping applied.

Since the script is just a function body, these values will already be defined, so you don't have to import them (see examples below).

See octokit/rest.js for the API client documentation.

Breaking Changes

V7

Version 7 of this action updated the runtime to Node 20 - https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-javascript-actions

All scripts are now run with Node 20 instead of Node 16 and are affected by any breaking changes between Node 16 and 20

The previews input now only applies to GraphQL API calls as REST API previews are no longer necessary - https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/.

V6

Version 6 of this action updated the runtime to Node 16 - https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-javascript-actions

All scripts are now run with Node 16 instead of Node 12 and are affected by any breaking changes between Node 12 and 16.

V5

Version 5 of this action includes the version 5 of @actions/github and @octokit/plugin-rest-endpoint-methods. As part of this update, the Octokit context available via github no longer has REST methods directly. These methods are available via github.rest.* - https://github.com/octokit/plugin-rest-endpoint-methods.js/releases/tag/v5.0.0

For example, github.issues.createComment in V4 becomes github.rest.issues.createComment in V5

github.request, github.paginate, and github.graphql are unchanged.

Development

See development.md.

Reading step results

The return value of the script will be in the step's outputs under the "result" key.

- uses: actions/github-script@v7
  id: set-result
  with:
    script: return "Hello!"
    result-encoding: string
- name: Get result
  run: echo "${{steps.set-result.outputs.result}}"

See "Result encoding" for details on how the encoding of these outputs can be changed.

Result encoding

By default, the JSON-encoded return value of the function is set as the "result" in the output of a github-script step. For some workflows, string encoding is preferred. This option can be set using the result-encoding input:

- uses: actions/github-script@v7
  id: my-script
  with:
    result-encoding: string
    script: return "I will be string (not JSON) encoded!"

Retries

By default, requests made with the github instance will not be retried. You can configure this with the retries option:

- uses: actions/github-script@v7
  id: my-script
  with:
    result-encoding: string
    retries: 3
    script: |
      github.rest.issues.get({
        issue_number: context.issue.number,
        owner: context.repo.owner,
        repo: context.repo.repo,
      })

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:

- uses: actions/github-script@v7
  id: my-script
  with:
    result-encoding: string
    retries: 3
    retry-exempt-status-codes: 400,401
    script: |
      github.rest.issues.get({
        issue_number: context.issue.number,
        owner: context.repo.owner,
        repo: context.repo.repo,
      })

By default, the following status codes will not be retried: 400, 401, 403, 404, 422 (source).

These retries are implemented using the octokit/plugin-retry.js plugin. The retries use exponential backoff to space out retries. (source)

Examples

Note that github-token is optional in this action, and the input is there in case you need to use a non-default token.

By default, github-script will use the token provided to your workflow.

Print the available attributes of context

- name: View context attributes
  uses: actions/github-script@v7
  with:
    script: console.log(context)

Comment on an issue

on:
  issues:
    types: [opened]

jobs:
  comment:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/github-script@v7
        with:
          script: |
            github.rest.issues.createComment({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              body: '๐Ÿ‘‹ Thanks for reporting!'
            })

Apply a label to an issue

on:
  issues:
    types: [opened]

jobs:
  apply-label:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/github-script@v7
        with:
          script: |
            github.rest.issues.addLabels({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              labels: ['Triage']
            })

Welcome a first-time contributor

You can format text in comments using the same Markdown syntax as the GitHub web interface:

on: pull_request_target

jobs:
  welcome:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/github-script@v7
        with:
          script: |
            // 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 = github.rest.issues.listForRepo.endpoint.merge({
              ...context.issue,
              creator,
              state: 'all'
            })
            const issues = await github.paginate(opts)

            for (const issue of issues) {
              if (issue.number === context.issue.number) {
                continue
              }

              if (issue.pull_request) {
                return // Creator is already a contributor.
              }
            }

            await github.rest.issues.createComment({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              body: `**Welcome**, new contributor!

                Please make sure you've read our [contributing guide](CONTRIBUTING.md) and we look forward to reviewing your Pull request shortly โœจ`
            })

Download data from a URL

You can use the github object to access the Octokit API. For instance, github.request

on: pull_request

jobs:
  diff:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/github-script@v7
        with:
          script: |
            const diff_url = context.payload.pull_request.diff_url
            const result = await github.request(diff_url)
            console.log(result)

(Note that this particular example only works for a public URL, where the diff URL is publicly accessible. Getting the diff for a private URL requires using the API.)

This will print the full diff object in the screen; result.data will contain the actual diff text.

Run custom GraphQL queries

You can use the github.graphql object to run custom GraphQL queries against the GitHub API.

jobs:
  list-issues:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/github-script@v7
        with:
          script: |
            const query = `query($owner:String!, $name:String!, $label:String!) {
              repository(owner:$owner, name:$name){
                issues(first:100, labels: [$label]) {
                  nodes {
                    id
                  }
                }
              }
            }`;
            const variables = {
              owner: context.repo.owner,
              name: context.repo.repo,
              label: 'wontfix'
            }
            const result = await github.graphql(query, variables)
            console.log(result)

Run a separate file

If you don't want to inline your entire script that you want to run, you can use a separate JavaScript module in your repository like so:

on: push

jobs:
  echo-input:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/github-script@v7
        with:
          script: |
            const script = require('./path/to/script.js')
            console.log(script({github, context}))

And then export a function from your module:

module.exports = ({github, context}) => {
  return context.payload.client_payload.value
}

Note that because you can't require things like the GitHub context or Actions Toolkit libraries, you'll want to pass them as arguments to your external function.

Additionally, you'll want to use the checkout action to make sure your script file is available.

Run a separate file with an async function

You can also use async functions in this manner, as long as you await it in the inline script.

In your workflow:

on: push

jobs:
  echo-input:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/github-script@v7
        env:
          SHA: '${{env.parentSHA}}'
        with:
          script: |
            const script = require('./path/to/script.js')
            await script({github, context, core})

And then export an async function from your module:

module.exports = async ({github, context, core}) => {
  const {SHA} = process.env
  const commit = await github.rest.repos.getCommit({
    owner: context.repo.owner,
    repo: context.repo.repo,
    ref: `${SHA}`
  })
  core.exportVariable('author', commit.data.commit.author.email)
}

Use npm packages

Like importing your own files above, you can also use installed modules. Note that this is achieved with a wrapper on top require, so if you're trying to require a module inside your own file, you might need to import it externally or pass the require wrapper to your file:

on: push

jobs:
  echo-input:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: '20.x'
      - run: npm ci
      # or one-off:
      - run: npm install execa
      - uses: actions/github-script@v7
        with:
          script: |
            const execa = require('execa')

            const { stdout } = await execa('echo', ['hello', 'world'])

            console.log(stdout)

Use ESM import

To import an ESM file, you'll need to reference your script by an absolute path and ensure you have a package.json file with "type": "module" specified.

For a script in your repository src/print-stuff.js:

export default function printStuff() {
  console.log('stuff')
}
on: push

jobs:
  print-stuff:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/github-script@v7
        with:
          script: |
            const { default: printStuff } = await import('${{ github.workspace }}/src/print-stuff.js')

            await printStuff()

Use scripts with jsDoc support

If you want type support for your scripts, you could use the command below to install the github-script type declaration.

$ npm i -D @types/github-script@github:actions/github-script

And then add the jsDoc declaration to your script like this:

// @ts-check
/** @param {import('@types/github-script').AsyncFunctionArguments} AsyncFunctionArguments */
export default async ({ core, context }) => {
  core.debug("Running something at the moment");
  return context.actor;
};

Use env as input

You can set env vars to use them in your script:

on: push

jobs:
  echo-input:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/github-script@v7
        env:
          FIRST_NAME: Mona
          LAST_NAME: Octocat
        with:
          script: |
            const { FIRST_NAME, LAST_NAME } = process.env

            console.log(`Hello ${FIRST_NAME} ${LAST_NAME}`)

Using a separate GitHub token

The GITHUB_TOKEN used by default is scoped to the current repository, see Authentication in a workflow.

If you need access to a different repository or an API that the GITHUB_TOKEN doesn't have permissions to, you can provide your own PAT as a secret using the github-token input.

Learn more about creating and using encrypted secrets

on:
  issues:
    types: [opened]

jobs:
  apply-label:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/github-script@v7
        with:
          github-token: ${{ secrets.MY_PAT }}
          script: |
            github.rest.issues.addLabels({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              labels: ['Triage']
            })

github-script's People

Contributors

36degrees avatar bhavanakonchada avatar brcrista avatar buger avatar bullenj01 avatar danmichaelo avatar dependabot[bot] avatar desrosj avatar francisfuzz avatar hfaulds avatar jcansdale avatar jclem avatar jj avatar josh- avatar joshmgross avatar karlhorky avatar kevgo avatar leandredasilva avatar luketomlinson avatar matissehack avatar michaeldeboey avatar mjpieters avatar nihalgonsalves avatar nschonni avatar orta avatar peternitschemi avatar pjquirk avatar robandpdx avatar robyoung avatar viktorlott avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

github-script's Issues

Deprecation warning when using "Apply a label to an issue" example from README

When I use the "Apply a label to an issue" example from the README, I get the following deprecation warning. I am using actions/[email protected].

Run actions/[email protected]
2
  with:
3
    github-token: ***
4
    script: github.issues.addLabels({...context.issue, labels: ['needs version bump']})
5
  
6
    debug: false
7
    user-agent: actions/github-script
8
Deprecation: [@octokit/rest] "number" parameter is deprecated for ".issues.addLabels()". Use "issue_number" instead
9
    at /home/runner/work/_actions/actions/github-script/0.3.0/node_modules/@octokit/rest/plugins/register-endpoints/register-endpoints.js:71:26
10
    at Array.forEach (<anonymous>)
11
    at Object.patchedMethod [as addLabels] (/home/runner/work/_actions/actions/github-script/0.3.0/node_modules/@octokit/rest/plugins/register-endpoints/register-endpoints.js:67:26)
12
    at eval (eval at main (/home/runner/work/_actions/actions/github-script/0.3.0/main.js:19:14), <anonymous>:3:15)
13
    at main (/home/runner/work/_actions/actions/github-script/0.3.0/main.js:20:24)
14
    at Object.<anonymous> (/home/runner/work/_actions/actions/github-script/0.3.0/main.js:5:1)
15
    at Module._compile (internal/modules/cjs/loader.js:774:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
17
    at Module.load (internal/modules/cjs/loader.js:641:32)
18
    at Function.Module._load (internal/modules/cjs/loader.js:556:12) {
19
  name: 'Deprecation'
20
}

Unrecognized named-value: 'github' in defaults.run

I am using github runner to build app for Android, iOS and Web. We have multiple sharing code projects at the application layer, so we need to config working-directory.

If I using this hard code. The runner works well

defaults:
  run:
    working-directory: manabie_teacher

Then I update script to require input for flexible building, but It's not working.

name: Delivery
on:
  workflow_dispatch:
    inputs:
      flavor:
        description: 'Flavor'
        required: true
        default: 'staging'
      working-directory:
        description: 'Working Directory'
        required: true
        default: 'manabie_teacher'

defaults:
  run:
    working-directory: ${{ github.event.inputs.working-directory }}

jobs:
  delivery-android:
    runs-on: [self-hosted, macOS]
    steps:
      - run: echo "::set-env name=DART_HOME::$RUNNER_TOOL_CACHE/flutter/bin/cache/dart-sdk/bin"
      - run: echo "::set-env name=FLUTTER_HOME::$RUNNER_TOOL_CACHE/flutter/bin"
      - run: echo "::set-env name=ANDROID_HOME::$RUNNER_TOOL_CACHE/sdk"
      - run: echo "::add-path::$DART_HOME"
      - run: echo "::add-path::$FLUTTER_HOME"
      - run: echo "::add-path::$ANDROID_HOME"
      - uses: actions/checkout@v2
        with:
          ref: ${{ github.ref }}

      - uses: actions/setup-java@v1
        with:
          java-version: '12.x'

      - run: flutter pub get

      - name: Build Staging
        if : ${{ github.event.inputs.flavor == 'staging' }}
        run: make build-staging-android
      - name: Push Staging
        if : ${{ github.event.inputs.flavor == 'staging' }}
        run: make push-android token=${{ secrets.FIREBASE_TOKEN }}

      - name: Build Production
        if: ${{ github.event.inputs.flavor == 'production' }}
        run: make build-production-android
      - name: Push Production
        if: ${{ github.event.inputs.flavor == 'production' }}
        run: make push-prod-android token=${{ secrets.FIREBASE_TOKEN }}

Error:

The workflow is not valid. .github/workflows/delivery.yml (Line: 16, Col: 24): Unrecognized named-value: 'github'. Located at position 1 within expression: github.event.inputs.working-directory

Cannot use `core` in script

I want to let my github-script step fail (because an exception appeared). Is this somehow possible?

I tried to return a non-zero exit code via return 42 but that only writes 42 to output variable result.

I tried to use core.setFailed('message') as in GitHub example code but it failed with ReferenceError: core is not defined.

I tried defining core using const core = require('@actions/core') but it failed with ReferenceError: require is not defined.

As there is already issue #6 stating require cannot be used I tried workaround described there (adding const require = global.require || global.process.mainModule.constructor._load; before code) but it failed with Error: Cannot find module '@actions/core'.

How can I let my step fail? Bonus points for letting it fail with a specified exit code.

Complete code I tried:

script: |
  const require = global.require || global.process.mainModule.constructor._load
  const core = require('@actions/core')
  core.setFailed('message')
  return 42

createComment 404 Error

Thank you ๐Ÿ™‡โ€โ™€ for wanting to create an issue in this repository. Before you do, please ensure you are filing the issue in the right place. Issues should only be opened on if the issue relates to code in this repository.

This is my yml file and it is resulting in the following error

    steps:
      - name: "test comment"
        uses: actions/[email protected]
        with:
          github-token: ${{secrets.ACTIONS_TOKEN}}
          script: |
            github.issues.createComment({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              body: 'test'
            })

Error:

##[error]Unhandled error: HttpError: Not Found
...
  request: {
    method: 'POST',
    url: 'https://api.github.com/repos/xxxxx/xxxxxxx/issues//comments',

Seems like there is a url path issue. Note the double slash after issues.

Add helper function for reading YAML

A common pattern I've seen (and used) for complex configuration of an action is to read a file in the .github directory of a repo. Usually these files are yaml.

How about adding a yaml loader helper script to the global context (attach to github or context maybe?)

I'm happy to implement it, but wanted to start a discussion first.

.

.

GithubAction REPL

Hey Guys.

thanks for this awesome Github Action. I have used Github Actions in a lot of projects and from time to time stumble over some very basic problems.

the actual deal breaker is the long feedback loop you get, when changing workflow files and waiting for the actual events which trigger them (most of the time we need to merge the workflows into the master branch, to trial and error with them).

thats a major pain.

after reading the README of this repo I thought about a REPL for Github Actions.

something like a website in which you can type your github workflow file, and let the REPL simulate a certain api event, so one can see the actual outcome (without the need to commit the workflow, merge it into master and wait for the actual events to happen).

not sure this is something which already exists (and I am not aware of).

also I am not sure this is something which should belong here... I will leave it here, maybe you guys know the right place to discuss this further.

eslint-plugin-actions: ESLint plugin to lint inline scripts in workflow

(Not really an issue)

First of all, thank you for the great action!

Inlining scripts in the workflow file has perks like not having to checkout the repo, but maintainability is an issue. (#38) So I've created eslint-plugin-actions, an ESLint plugin to allow linting inline scripts in literal blocks (|) of workflow files.

A JS script in a GitHub workflow editor has red squiggly underlines. A tooltip explains the problem.

Please feel free to share your comments and feedback!

If appropriate, it'd be nice to add a link to the project in README.

Unexpected token '}' error

Hi, thanks for the very useful GHA tool here. The following error is seen here:

SyntaxError: Unexpected token '}'
    at new AsyncFunction (<anonymous>)
    at main (/home/runner/work/_actions/actions/github-script/0.3.0/main.js:19:14)
    at Object.<anonymous> (/home/runner/work/_actions/actions/github-script/0.3.0/main.js:5:1)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
    at internal/main/run_main_module.js:17:11
##[error]Unexpected token '}'
##[error]Node run failed with exit code 1

but it's not clear what's going wrong, since it looks correctly written (and has worked in other repositories just fine). We have a step that looks like so:

    - name: Comment that something failed
      if: failure()
      uses: actions/[email protected]
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}
        script: |
          github.issues.createComment({...context.issue, body: ":cry: Something went wrong. I am not able to push. Check the [Actions pipeline](https://github.com/${{ github.repository }}/actions?query=workflow%3A%22Tag+Creator%22) to see what happened. If you make any more changes, you probably want to re-trigger me again by adding the `bumpversion/${{ env['BV_PART'] }}` label again."})
          github.issues.removeLabels({...context.issue, "bumpversion/${{ env['BV_PART'] }}" })

with the following env:

  env:
    IS_MAJOR: false
    IS_MINOR: false
    IS_PATCH: true
    PR_NUMBER: 38
    PR_TITLE: Revert "Revert "ci: Add release via bumpversion tag GHA workflow""
    GITHUB_HEAD_REF: revert-36-revert-35-ci-add-publishing-throuhg-bumpversion-label
    BV_PART: patch

Dependencies are outdated

github-script's dependencies for Octokit are outdated (#59). @actions/github is listed as version 3.0.0, which is a full version behind the latest. The latest version of Octokit removes deprecated methods which haven't even been deprecated yet. Although these methods are still documented as of writing, this caused a moment of confusion for me. Please consider updating!

Preview flash is not accepted when using ant-man and creating a deployment status

Not entirely sure if this is related to this repository, but I'm having issues switching from octokit/request-action to actions/github-script.

In my workflow, I create a deployment using chrnorm/deployment-action.

This works fine.

Create deployment status

octokit/request-action

In a following step, when the actual deployment fails, I mark the deployment as failure using octokit/request-action.

- name: "Mark deployment as success"
  if: "failure()"
  uses: "octokit/[email protected]"
  with:
    auto_inactive: false
    deployment_id: "${{ steps.create-deployment.outputs.deployment_id }}"
    environment: "master"
    environment_url: "https://localheinz.com"
    owner: "localheinz"
    repo: "localheinz.com"
    repository: "${{ github.repository }}"
    route: "POST /repos/:owner/:repo/deployments/:deployment_id/statuses"
    state: "success"
  env:
    GITHUB_TOKEN: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"

This works fine.

actions/github-script

Now, because I find that actions/github-script gives me more flexibility, I have switched to using it:

 - name: "Mark deployment as success"
   if: "failure()"
-  uses: "octokit/[email protected]"
+  uses: "actions/[email protected]"
   with:
-    auto_inactive: false
-    deployment_id: "${{ steps.create-deployment.outputs.deployment_id }}"
-    environment: "master"
-    environment_url: "https://localheinz.com"
-    owner: "localheinz"
-    repo: "localheinz.com"
-    repository: "${{ github.repository }}"
-    route: "POST /repos/:owner/:repo/deployments/:deployment_id/statuses"
-    state: "success"
-  env:
-    GITHUB_TOKEN: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
+    github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
+    script: |
+      github.repos.createDeploymentStatus({
+        auto_inactive: false,
+        deployment_id: "${{ steps.create-deployment.outputs.deployment_id }}",
+        environment: "master",
+        environment_url: "https://localheinz.com",
+        mediaType: {
+          previews: [
+            "ant-man",
+            "flash"
+          ]
+        },
+        owner: context.repo.owner,
+        repo: context.repo.repo,
+        state: "success"
+      })

As you can see, I have provided the media types using the mediaType property

  • ant-man, required for using the environment parameter
  • flash, required for using the environment_url parameter

as documented at

This fails with Invalid value for parameter 'environment': "master" as you can see here:

2020-03-19T21:56:26.6439099Z ##[group]Run actions/[email protected]
2020-03-19T21:56:26.6439589Z with:
2020-03-19T21:56:26.6440555Z   github-token: ***
2020-03-19T21:56:26.6441745Z   script: github.repos.createDeploymentStatus({
  auto_inactive: true,
  deployment_id: "1234567890",
  environment: "master",
  environment_url: "https://localheinz.com",
  mediaType: {
    previews: [
      "ant-man",
      "flash"
    ]
  },
  owner: context.repo.owner,
  repo: context.repo.repo,
  state: "success"
})

2020-03-19T21:56:26.6442704Z   debug: false
2020-03-19T21:56:26.6443342Z   user-agent: actions/github-script
2020-03-19T21:56:26.6443720Z   result-encoding: json
2020-03-19T21:56:26.6446531Z ##[endgroup]
2020-03-19T21:56:26.7568708Z RequestError [HttpError]: Invalid value for parameter 'environment': "master"
2020-03-19T21:56:26.7569775Z     at /home/runner/work/_actions/actions/github-script/0.8.0/dist/index.js:4278:15
2020-03-19T21:56:26.7570432Z     at Array.forEach (<anonymous>)
2020-03-19T21:56:26.7571280Z     at /home/runner/work/_actions/actions/github-script/0.8.0/dist/index.js:4216:12
2020-03-19T21:56:26.7571799Z     at Array.forEach (<anonymous>)
2020-03-19T21:56:26.7572517Z     at validate (/home/runner/work/_actions/actions/github-script/0.8.0/dist/index.js:4189:23) {
2020-03-19T21:56:26.7573221Z   name: 'HttpError',
2020-03-19T21:56:26.7573630Z   status: 400,
2020-03-19T21:56:26.7574114Z   headers: {},
2020-03-19T21:56:26.7574562Z   request: {
2020-03-19T21:56:26.7575193Z     method: 'POST',
2020-03-19T21:56:26.7575947Z     baseUrl: 'https://api.github.com',
2020-03-19T21:56:26.7576393Z     headers: {
2020-03-19T21:56:26.7577003Z       accept: 'application/vnd.github.v3+json',
2020-03-19T21:56:26.7577752Z       'user-agent': 'actions/github-script octokit.js/16.43.1 Node.js/12.13.1 (Linux 5.0; x64)'
2020-03-19T21:56:26.7578279Z     },
2020-03-19T21:56:26.7578887Z     mediaType: { format: '', previews: [Array] },
2020-03-19T21:56:26.7579372Z     request: { hook: [Function: bound bound register], validate: [Object] },
2020-03-19T21:56:26.7580095Z     url: '/repos/:owner/:repo/deployments/:deployment_id/statuses',
2020-03-19T21:56:26.7580573Z     auto_inactive: true,
2020-03-19T21:56:26.7580998Z     deployment_id: 1234567890,
2020-03-19T21:56:26.7581574Z     environment: 'master',
2020-03-19T21:56:26.7582190Z     environment_url: 'https://localheinz.com',
2020-03-19T21:56:26.7582805Z     owner: 'localheinz',
2020-03-19T21:56:26.7583362Z     repo: 'localheinz.com',
2020-03-19T21:56:26.7583923Z     state: 'success'
2020-03-19T21:56:26.7584340Z   }
2020-03-19T21:56:26.7584730Z }
2020-03-19T21:56:26.7591748Z ##[error]Invalid value for parameter 'environment': "master"

As an alternative, I have tried using the previews attribute

   with:
     debug: true
     github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
+    previews: "ant-man,flash"
     script: |
       github.repos.createDeploymentStatus({
         auto_inactive: false,
         deployment_id: "${{ steps.create-deployment.outputs.deployment_id }}",
         environment: "master",
         environment_url: "https://localheinz.com",
-        mediaType: {
-          previews: [
-            "ant-man",
-            "flash"
-          ]
-        },
         owner: context.repo.owner,
         repo: context.repo.repo,
         state: "success"

as documented in action.yml.

This again fails with Invalid value for parameter 'environment': "master" as you can see here:

2020-03-19T22:43:32.3037918Z ##[group]Run actions/[email protected]
2020-03-19T22:43:32.3038353Z with:
2020-03-19T22:43:32.3039328Z   github-token: ***
2020-03-19T22:43:32.3039768Z   previews: ant-man,flash
2020-03-19T22:43:32.3040472Z   script: github.repos.createDeploymentStatus({
  auto_inactive: true,
  deployment_id: "1234567890",
  environment: "master",
  environment_url: "https://localheinz.com",
  owner: context.repo.owner,
  repo: context.repo.repo,
  state: "success"
})

2020-03-19T22:43:32.3041664Z   debug: false
2020-03-19T22:43:32.3042094Z   user-agent: actions/github-script
2020-03-19T22:43:32.3042535Z   result-encoding: json
2020-03-19T22:43:32.3044720Z ##[endgroup]
2020-03-19T22:43:32.4054392Z RequestError [HttpError]: Invalid value for parameter 'environment': "master"
2020-03-19T22:43:32.4055596Z     at /home/runner/work/_actions/actions/github-script/0.8.0/dist/index.js:4278:15
2020-03-19T22:43:32.4056521Z     at Array.forEach (<anonymous>)
2020-03-19T22:43:32.4058571Z ##[error]Invalid value for parameter 'environment': "master"
2020-03-19T22:43:32.4062517Z     at /home/runner/work/_actions/actions/github-script/0.8.0/dist/index.js:4216:12
2020-03-19T22:43:32.4063169Z     at Array.forEach (<anonymous>)
2020-03-19T22:43:32.4063984Z     at validate (/home/runner/work/_actions/actions/github-script/0.8.0/dist/index.js:4189:23) {
2020-03-19T22:43:32.4064806Z   name: 'HttpError',
2020-03-19T22:43:32.4065332Z   status: 400,
2020-03-19T22:43:32.4065838Z   headers: {},
2020-03-19T22:43:32.4066321Z   request: {
2020-03-19T22:43:32.4066970Z     method: 'POST',
2020-03-19T22:43:32.4067767Z     baseUrl: 'https://api.github.com',
2020-03-19T22:43:32.4068460Z     headers: {
2020-03-19T22:43:32.4069222Z       accept: 'application/vnd.github.v3+json',
2020-03-19T22:43:32.4070019Z       'user-agent': 'actions/github-script octokit.js/16.43.1 Node.js/12.13.1 (Linux 5.0; x64)'
2020-03-19T22:43:32.4070601Z     },
2020-03-19T22:43:32.4071242Z     mediaType: { format: '', previews: [Array] },
2020-03-19T22:43:32.4072010Z     request: { hook: [Function: bound bound register], validate: [Object] },
2020-03-19T22:43:32.4072815Z     url: '/repos/:owner/:repo/deployments/:deployment_id/statuses',
2020-03-19T22:43:32.4073381Z     auto_inactive: true,
2020-03-19T22:43:32.4073897Z     deployment_id: 210675589,
2020-03-19T22:43:32.4074870Z     environment: 'master',
2020-03-19T22:43:32.4075610Z     environment_url: 'https://localheinz.com',
2020-03-19T22:43:32.4076305Z     owner: 'localheinz',
2020-03-19T22:43:32.4076957Z     repo: 'localheinz.com',
2020-03-19T22:43:32.4077636Z     state: 'success'
2020-03-19T22:43:32.4078155Z   }
2020-03-19T22:43:32.4078756Z }

Now, when I remove the environment parameter and assume the environment that was used when creating the deployment in the first place:

   with:
     debug: true
     github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
-    previews: "ant-man,flash"
+    previews: "ant-man"
     script: |
       github.repos.createDeploymentStatus({
         auto_inactive: false,
         deployment_id: "${{ steps.create-deployment.outputs.deployment_id }}",
-        environment: "master",
         environment_url: "https://localheinz.com",
         owner: context.repo.owner,
         repo: context.repo.repo,

this works fine.

Question

Why does the original request work with octokit/request-action, but not with actions/github-script?

Provide optional toString encoding for building strings with result

I'm trying to build a branch name using a part of context.ref via this script, but the JSON encoding is getting in the way:

name: Push docs

on:
  push:
    branch:
      - releases/**

jobs:
  load:
    runs-on: ubuntu-latest
    steps:
    - id: get-release-name
      name: Get release name with github-script
      uses: actions/[email protected]
      with:
        github-token: ${{github.token}}
        script: return context.ref.replace(/^refs\/heads\/releases\//, '')
    - name: Push docs
      env:
        DOCS_BRANCH: docs/${{steps.get-release-name.outputs.result}}
      run: |
        printenv | grep DOCS_BRANCH

The output is:

DOCS_BRANCH=docs/"v1"

This can be still usable if you're dropping the value into a shell context that will eat the quotes, but is problematic if you're using it to build parameterized inputs for an action. If you made it so you could optionally set result-encoding: string to override the json default and just cast the result to a string:

    steps:
    - id: get-branch-name
      name: Get branch name with github-script
      uses: actions/[email protected]
      with:
        github-token: ${{github.token}}
        result-encoding: string
        script: return context.ref.replace(/^refs\/heads\/releases\//, '')
    - name: Push docs
      uses: myorg/push-docs@v1
      with:
        commit-to: docs/${{steps.get-release-name.outputs.result}}

Then the outputs.result of the step would be usable in building strings later in the job

Error: The `set-env` command is deprecated and will be disabled on November 16th. Please upgrade to using Environment Files.

Describe the bug
A clear and concise description of what the bug is.

When use core.exportVariable('envVar', 'Val'); as script, there is an error:

Error: The `set-env` command is deprecated and will be disabled on November 16th. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

Log link: https://github.com/theowenyoung/test-actions/actions/runs/359544404

To Reproduce
Steps to reproduce the behavior:

"on":
  - workflow_dispatch
jobs:
  print:
    name: Print 0
    runs-on: ubuntu-latest
    steps:
      - name: test
        uses: actions/github-script@v3
        with:
          script: |
            core.exportVariable('envVar', 'Val');
            return 1

From https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

I think the action should update the @actions/core dependence to 1.2.6

Make debugging easier

Currently, it's really difficult to determine where an error occurred in a user's script input, because of how it's evaluated.

One option for improving this might be two wrap the user script in a string for creating the async function, and then writing that to a file and executing it.

Expose @actions/io

It would be great to include @actions/io in the arguments passed into the script function body. I've found it incredibly useful when writing custom actions.

Misleading "Cannot find module" error message

When using the approach described in the "Run a separate file", I encountered a very misleading error message:

Error: Cannot find module '/home/runner/work/project-name/project-name/path/to/separate-script.js'
    at webpackEmptyContext (/home/runner/work/_actions/actions/github-script/v2/dist/index.js:9475:9)
    at eval (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v2/dist/index.js:7985:56), <anonymous>:4:7)
    at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v2/dist/index.js:7986:12)
    at main (/home/runner/work/_actions/actions/github-script/v2/dist/index.js:8011:26)
    at Module.833 (/home/runner/work/_actions/actions/github-script/v2/dist/index.js:7995:1)
    at __webpack_require__ (/home/runner/work/_actions/actions/github-script/v2/dist/index.js:22:30)
    at startup (/home/runner/work/_actions/actions/github-script/v2/dist/index.js:37:19)
    at /home/runner/work/_actions/actions/github-script/v2/dist/index.js:43:18
    at Object.<anonymous> (/home/runner/work/_actions/actions/github-script/v2/dist/index.js:46:10)
    at Module._compile (internal/modules/cjs/loader.js:959:30) {
  code: 'MODULE_NOT_FOUND'
}

when using a workflow like this:

on: push

jobs:
  some-job:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/github-script@v2
        with:
          script: |
            const path = require('path')
            const scriptPath = path.resolve('./path/to/separate-script.js')
            await require(scriptPath)({context})

It kept me busy for a few hours because I tried to find out why separate-script.js could not be found like the error message says.
But in fact, it was a module that was required by separate-script.js which could not be found.

So separate-script.js did a require( 'some-missing-module' ) and the some-missing-module could not be found but the error message led into a completely wrong direction.

Here is an example showing the behavior: https://github.com/j-ulrich/github-actions-test/runs/879829284?check_suite_focus=true#step:3:11

To save other people from running into this, it would be great if this could be fixed if at all possible.

Get branch on context object.

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
I need to get the branch that triggered the event, ie context.branch
Describe the solution you'd like
A clear and concise description of what you want to happen.
For instance, dependabot making a PR, I have a script to git-checkout to it but I need to get the branch.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

import other modules?

Hello,

in my script I want to use fs to read the content of a file. But I can't import anything in the body. Is there a way to do this?

Comment api endpoint broken

Hi there! Great little action, I have used it in a few of our projects to automatically generate some comments on new PRs. It works great in one repo, but in another, the api request seems to fail with a duplicate / in the url:

    method: 'GET',
    url: 'https://api.github.com/repos/***/docs.***/issues//comments',
    headers: {
      accept: 'application/vnd.github.-preview+json',
      'user-agent': 'actions/github-script octokit-core.js/2.5.3 Node.js/12.13.1 (Linux 5.3; x64)',
      authorization: 'token [REDACTED]'
    },
    request: { agent: [Agent], hook: [Function: bound bound register] }

Notice how it's url: 'https://api.github.com/repos/***/docs.***/issues//comments', vs .../issues/comments. You can see the broken code here and the same, working code (slightly different syntax) here

context not passed to separate script file

Describe the bug
Following the example here: https://github.com/actions/github-script#run-a-separate-file I'd expect to be able to access the github and context arguments in the separate file.

However it's returning an error:

TypeError: Cannot read property 'payload' of undefined
    at module.exports (/home/runner/work/nct-lz-branch-action-dev/nct-lz-branch-action-dev/src/branchNameCheck.js:2:20)
    at eval (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v2/dist/index.js:7985:56), <anonymous>:4:13)
    at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v2/dist/index.js:7986:12)
    at main (/home/runner/work/_actions/actions/github-script/v2/dist/index.js:8011:26)
    at Module.833 (/home/runner/work/_actions/actions/github-script/v2/dist/index.js:7995:1)
    at __webpack_require__ (/home/runner/work/_actions/actions/github-script/v2/dist/index.js:22:30)
    at startup (/home/runner/work/_actions/actions/github-script/v2/dist/index.js:37:19)
    at /home/runner/work/_actions/actions/github-script/v2/dist/index.js:43:18
    at Object.<anonymous> (/home/runner/work/_actions/actions/github-script/v2/dist/index.js:46:10)
    at Module._compile (internal/modules/cjs/loader.js:959:30)

If I change the example separate file to return github that works fine:

Run actions/github-script@v2. 
with:  
script: const script = require(/`${process.env.GITHUB_WORKSPACE}/src/branchNameCheck.js/`). 
console.log(script({github, context})). 
  github-token: ***. 
  debug: false. 
  user-agent: actions/github-script. 
  result-encoding: json. 
{. 
  github: OctokitWithDefaults {. 
    request: [Function: newApi] {. 
      endpoint: [Function],  
      defaults: [Function: bound withDefaults]. 
    },  
  graphql: [Function: newApi] {. 
...  
...  
...

Changing the example to return context returns undefined

I also tried with `actions/github-script@v3 but no joy there either.

To Reproduce
Steps to reproduce the behavior:

  1. Use the Separate file example from (https://github.com/actions/github-script#run-a-separate-file)
  2. Check the Action output
  3. See context is undefined

Expected behavior
I'd expect to be able to access the context values in the separate script file, or that the example doesn't fail

Getting SyntaxError when using await on version 0.5.0

After rolling the version forward to 0.5.0, my scripts that use await are now failing with:

SyntaxError: await is only valid in async function

My repo is private, so I created an example workflow with the below steps. Full thing is here: https://github.com/kuritz/gtihub-script-test/blob/master/.github/workflows/push.yml

      - name: List checks for ref 0.4.0
        uses: actions/[email protected]
        with:
          github-token: ${{ github.token }}
          script: |
            const result = await github.checks.listForRef({
              owner: context.repo.owner,
              repo: context.repo.repo,
              ref: context.sha,
              status: "in_progress"
            })
            console.log(result)

      - name: List checks for ref 0.5.0
        uses: actions/[email protected]
        with:
          github-token: ${{ github.token }}
          script: |
            const result = await github.checks.listForRef({
              owner: context.repo.owner,
              repo: context.repo.repo,
              ref: context.sha,
              status: "in_progress"
            })
            console.log(result)

And here is a test run of the above: https://github.com/kuritz/gtihub-script-test/runs/462672595?check_suite_focus=true

.

.

Downloading an URL

Maybe the question is a bit more general, in the sense of which modules are available in the script, but in this case I need to download the diff_url in a pull request, which I obtain with:

        const diff_url = context.payload.pull_request.diff_url

BTW, specifying the structure of a context.payload object would also be useful

But I don't what I can use to get the contents of that URL into the script. Any idea?

import npm packages

Is it possible to require npm packages in the script or script file? Something like

script: |
  const pkg = require('some-npm-package')
  pkg.useMethod()

My script to merge pullrequests stopped working after major version upgrade

I was using this script:

name: Dependabot

on:
  pull_request:
    branches:
      - master

jobs:
  automerge:
    name: Merge Dependabot pull request
    runs-on: ubuntu-latest
    if: github.base_ref == 'master' && github.actor == 'dependabot[bot]'
    steps:
      - uses: actions/github-script@v2
        with:
          github-token: ${{secrets.GITHUB_TOKEN}}
          script: |
            github.pullRequests.merge({
              owner: context.repo.owner,
              repo: context.repo.repo,
              pull_number: context.payload.pull_request.number
            })

Now I get:
Unhandled error: TypeError: Cannot read property 'merge' of undefined

Aren't there github.pullRequests anymore? I didn't find it on the documentation.

Add GraphQL client in the inputs too

Is your feature request related to a problem? Please describe.

Hi, I'd like to use this GitHub Action to organize a GitHub project when issues are labeled/unlabeled/closed/created.

My issue is that the workflow reacts on a trigger on the issue and I can't easily/efficiently make a link to the associated project cards with the REST API of GitHub.

Describe the solution you'd like

I think it would be much more powerful if we could use a mix of GraphQL and REST calls.

To do so, I suggest to pass both clients as input to the script in the action. The parameter github could be deprecated and parameters rest and graphql added (minor update).

When you release a breaking version later on, you could remove the parameter github.

Describe alternatives you've considered

The only other alternative I see would be to write my own action. I could but my use-case seems to fit into the mission of github-script so I think that the community would benefit from it being unlocked here.

Additional context

I'd be willing to submit a PR.

I have never worked on GitHub actions before, seems like a great opportunity to discover how it works (and I could add a non-spammy contribution to Hacktoberfest ๐Ÿ˜† ).

Rename default branch

๐Ÿ‘‹ This issue is to track the move over to using main as the default branch for this repo. Weโ€™d love your team's help in completing this transition.

Do not remove your old default branch, customers are going to be using it. We will be sending messages out about these changes, but if you want to message in your repository, that's fine as well.

  • Create a main branch.
  • You might need to rebase any pull requests you want to merge before changing the default branch.
  • Change the default branch in settings to main.
  • Update any documentation in this repo to refer to the new branch name, although using the version tag is still preferred.
  • Check that this Action works correctly for users who have a repository with a custom default branch name.
  • Close this issue and celebrate ๐ŸŽ‰

We are aiming to complete this work by July 17th.

Consider building without ncc

Currently, this project uses vercel/ncc in order to build a single JavaScript file that contains all that's needed to run this action.

Unfortunately, bugs such as #68 keep occurring, and it's making me think that it may not be worth the convenience of avoiding checking node_modules in to source control.

The negative impact I'm concerned with here would be that we'd be un-zipping hundreds of files each time this action runs. This will require some testing to see if the impact is noticeable.

Cannot use require in script

The way the function constructor is created, it is not possible to use require directly.
Calling require in your script will result in: ReferenceError: require is not defined.

As a temporary hotfix, you can call the following before your require call:

const require = global.require || global.process.mainModule.constructor._load;

Solution was adapted from here.

It would be great if the function constructor was adapted to allow normal require calls.

Try to create internal repository (enterprise)

Describe the bug
I am trying to create a repository in a workflow in an enterprise organization.
Unfortunately the parameter with the value 'visibility: "internal"' seems to be ignored.

To Reproduce
Using this code snippet

uses: actions/[email protected]
[...]
const data = await github.repos.createInOrg({
    org: "test-org",
    name: "Test-Organisation",
    auto_init: true,
    visibility: "internal"
});

Expected behavior
A repo should be created, which has the status internal, instead a public one is created.

Desktop (please complete the following information):
not relevant

createRelease and GITHUB_REF

Hi, I'd like to create automatically pre-release from tag. I use YAML below to do it.
My tag is v_test and it is on the release list like tag releases/tag/v_test, not release yet.
After createRelease there is still only tag, but no release. Function createRelease returns code 201, so release was created, but it is not available on release list. On the release list, there is only tag.
Surprisingly, release is available with tag name refs/tags/v_test and it is on /releases/tag/refs/tags/v_test.
I think, problem is with tag_name or createRelease.

name: RELEASE

on:
  push:
    tags:
      - 'v*'

jobs:
  build:
    runs-on: self-hosted
    steps:
      - name: CHECKOUT
        uses: actions/checkout@v2
      - name: PRERELEASE
        uses: actions/github-script@v2
        with:
          github-token: ${{secrets.GITHUB_TOKEN}}
          script: |
            const { repo: { owner, repo }, sha } = context;
            const release = await github.repos.createRelease({
                owner, repo,
                tag_name: process.env.GITHUB_REF,
                prerelease: true
            });

I solved it, by modification tag_name with YAML below to cut last part of tag name:

name: RELEASE

on:
  push:
    tags:
      - 'v*'

jobs:
  build:
    runs-on: self-hosted
    steps:
      - name: CHECKOUT
        uses: actions/checkout@v2
      - name: PRERELEASE
        uses: actions/github-script@v2
        with:
          github-token: ${{secrets.GITHUB_TOKEN}}
          script: |
            const { repo: { owner, repo }, sha } = context;
            const tag = process.env.GITHUB_REF.split('/').slice(-1)[0];
            const release = await github.repos.createRelease({
                owner, repo,
                tag_name: tag ,
                prerelease: true
            });

- name: GitHub Script uses: actions/[email protected]

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Unrecognized named-value: 'context'

This is the workflow I created (basically copied it from the readme):

name: coverage

on:
  pull_request:
    branches: [master]
    types: [opened]

jobs:
  coverage_link:
    runs-on: ubuntu-latest
    steps:
      - name: Link the coverage report
        uses: actions/[email protected]
        with:
          github-token: "${{secrets.GITHUB_TOKEN}}"
          script: |
            github.issues.createComment({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              body: "See the coverage report at https://${{secrets.reports_host}}/${{secrets.reports_path}}/${{context.issue.number}}"
            })

The workflow is supposed to put a comment at any new pull request, however the execution fails with:

The workflow is not valid. .github/workflows/coverage.yml (Line: 16, Col: 19): Unrecognized named-value: 'context'. Located at position 1 within expression: context.issue.number

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.