{"id":15018140,"url":"https://github.com/probot/adapter-github-actions","last_synced_at":"2025-04-13T04:59:51.590Z","repository":{"id":39022474,"uuid":"215620820","full_name":"probot/adapter-github-actions","owner":"probot","description":":electric_plug: An adapter that takes a Probot app and makes it compatible with GitHub Actions","archived":false,"fork":false,"pushed_at":"2025-04-07T05:38:07.000Z","size":1443,"stargazers_count":89,"open_issues_count":8,"forks_count":19,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-13T04:59:46.325Z","etag":null,"topics":["github-actions","nodejs","probot","probot-adapter"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/probot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-16T18:49:09.000Z","updated_at":"2025-04-07T05:38:10.000Z","dependencies_parsed_at":"2023-11-06T04:25:11.699Z","dependency_job_id":"fae99ebe-2669-4adc-a3a7-ff5dcac08fc4","html_url":"https://github.com/probot/adapter-github-actions","commit_stats":{"total_commits":159,"total_committers":13,"mean_commits":12.23076923076923,"dds":0.4528301886792453,"last_synced_commit":"ce07d2c623f8e144e1d905114b650939ccca6bd4"},"previous_names":["probot/actions-adapter"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/probot%2Fadapter-github-actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/probot%2Fadapter-github-actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/probot%2Fadapter-github-actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/probot%2Fadapter-github-actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/probot","download_url":"https://codeload.github.com/probot/adapter-github-actions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665756,"owners_count":21142123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions","nodejs","probot","probot-adapter"],"created_at":"2024-09-24T19:51:30.195Z","updated_at":"2025-04-13T04:59:51.565Z","avatar_url":"https://github.com/probot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :electric_plug: `@probot/adapter-github-actions`\n\n\u003e Adapter to run a [Probot](https://probot.github.io/) application function in [GitHub Actions](https://github.com/features/actions)\n\n[![Build Status](https://github.com/probot/adapter-github-actions/workflows/Test/badge.svg)](https://github.com/probot/adapter-github-actions/actions)\n\n## Usage\n\nCreate your Probot Application as always\n\n```js\n// app.js\nexport default (app) =\u003e {\n  app.on(\"issues.opened\", async (context) =\u003e {\n    const params = context.issue({ body: \"Hello World!\" });\n    await context.octokit.issues.createComment(params);\n  });\n};\n```\n\nThen in the entrypoint of your GitHub Action, require `@probot/adapter-github-actions` instead of `probot`\n\n```js\n// index.js\nimport { run } from \"@probot/adapter-github-actions\";\nimport app from \"./app.js\";\n\nrun(app).catch((error) =\u003e {\n  console.error(error);\n  process.exit(1);\n});\n```\n\nThen use `index.js` as your entrypoint in the `action.yml` file\n\n```yaml\nname: \"Probot app name\"\ndescription: \"Probot app description.\"\nruns:\n  using: \"node20\"\n  main: \"index.js\"\n```\n\n**Important**: Your external dependencies will not be installed, you have to either vendor them in by committing the contents of the `node_modules` folder, or compile the code to a single executable script (recommended). See [GitHub's documentation](https://docs.github.com/en/actions/creating-actions/creating-a-javascript-action#commit-tag-and-push-your-action-to-github)\n\nFor an example Probot App that is continuously published as GitHub Action, see https://github.com/probot/example-github-action#readme\n\n## How it works\n\n[Probot](https://probot.github.io/) is a framework for building [GitHub Apps](docs.github.com/apps), which is different to creating [GitHub Actions](https://docs.github.com/actions/) in many ways, but the functionality is the same:\n\nBoth get notified about events on GitHub, which you can act on. While a GitHub App gets notified about a GitHub event via a webhook request sent by GitHub, a GitHub Action can receive the event payload by reading a JSON file from the file system. We can abstract away the differences, so the same hello world example app shown above works in both environments.\n\nRelevant differences for Probot applications:\n\n1. You cannot authenticate as the app. The `probot` instance you receive is authenticated using a GitHub token. In most cases the token will be set to `secrets.GITHUB_TOKEN`, which is [an installation access token](https://docs.github.com/en/actions/reference/authentication-in-a-workflow#about-the-github_token-secret). The provided `GITHUB_TOKEN` expires when the job is done or after 6 hours, whichever comes first. You do not have access to an `APP_ID` or `PRIVATE_KEY`, you cannot create new tokens or renew the provided one.\n2. `secrets.GITHUB_TOKEN` is scoped to the current repository. You cannot read data from other repositories unless they are public, you cannot update any other repositories, or access organization-level APIs.\n3. You could provide a personal access token instead of `secrets.GITHUB_TOKEN` to workaround the limits of a repository-scoped token, but be sure you know what you are doing.\n4. You don't need to configure `WEBHOOK_SECRET`, because no webhook request gets sent, the event information can directly be retrieved from environment variables and the local file system.\n\nFor a more thorough comparison, see [@jasonetco's](https://github.com/jasonetco) posts:\n\n1. [Probot App or GitHub Action](https://jasonet.co/posts/probot-app-or-github-action/) (Jan 2019)\n2. [Update from April 2020](https://jasonet.co/posts/probot-app-or-github-action-v2/)\n\n## License\n\n[ISC](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprobot%2Fadapter-github-actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprobot%2Fadapter-github-actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprobot%2Fadapter-github-actions/lists"}