{"id":27942929,"url":"https://github.com/posit-dev/setup-air","last_synced_at":"2025-07-03T15:33:24.540Z","repository":{"id":289491491,"uuid":"971438997","full_name":"posit-dev/setup-air","owner":"posit-dev","description":"A GitHub Action to set up Air","archived":false,"fork":false,"pushed_at":"2025-06-18T17:07:19.000Z","size":1041,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-18T17:41:44.103Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://posit-dev.github.io/air/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/posit-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-04-23T14:20:15.000Z","updated_at":"2025-06-18T17:07:21.000Z","dependencies_parsed_at":"2025-04-28T21:25:10.725Z","dependency_job_id":"fab34794-68af-410c-a437-45da1bf7e67a","html_url":"https://github.com/posit-dev/setup-air","commit_stats":null,"previous_names":["davisvaughan/air-action","posit-dev/air-action","posit-dev/setup-air"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/posit-dev/setup-air","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fsetup-air","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fsetup-air/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fsetup-air/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fsetup-air/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posit-dev","download_url":"https://codeload.github.com/posit-dev/setup-air/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fsetup-air/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263350623,"owners_count":23453309,"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":[],"created_at":"2025-05-07T11:58:56.616Z","updated_at":"2025-07-03T15:33:24.514Z","avatar_url":"https://github.com/posit-dev.png","language":"TypeScript","readme":"# setup-air\n\nA GitHub Action to set up [Air](https://github.com/posit-dev/air).\n\n- Installs Air\n- Adds Air to the PATH\n- Caches Air to speed up consecutive runs on self-hosted runners\n\n## Contents\n\n- [Inputs](#inputs)\n- [Outputs](#outputs)\n- [Example actions](#example-actions)\n  - [Format with GitHub Suggestions](#format-with-github-suggestions)\n  - [Format with `--check`](#format-with---check)\n- [Customization](#customization)\n  - [Run arbitrary Air commands](#run-arbitrary-air-commands)\n  - [Install specific versions](#install-specific-versions)\n  - [GitHub authentication token](#github-authentication-token)\n- [Acknowledgements](#acknowledgments)\n\n## Inputs\n\n| Input | Description | Default |\n|---------------|-------------------------------------------|---------------|\n| `version` | The version of Air to install. See [Install specific versions](#install-specific-versions). | `latest` |\n| `github-token` | The GitHub token to use for authentication. Generally not required. | `secrets.GITHUB_TOKEN` |\n\n## Outputs\n\n| Output        | Description                            |\n|---------------|----------------------------------------|\n| `air-version` | The version of Air that was installed. |\n\n## Example actions\n\nIf you'd like to use Air to enforce style on your repository, use usethis to copy one of the following example actions from `examples/` into your `.github/workflows` folder.\n\n### Format with GitHub Suggestions\n\n```r\nusethis::use_github_action(url = \"https://github.com/posit-dev/setup-air/blob/main/examples/format-suggest.yaml\")\n```\n\nThis action runs `air format .` on every pull request.\nIf formatting is required, the check fails and suggestion comments are added directly to the pull request.\nWe recommend committing the suggestions in a single batch from the `Files changed` view, which will trigger a rerun of the check and delete the outdated suggestion comments.\nBefore using this action, ensure that you've locally run Air on your entire project at least once using `air format .` or the `Air: Format Workspace Folder` command in VS Code or Positron, otherwise you can end up with a very large amount of suggestions.\n\nThis action is great for managing pull requests from external contributors.\nEven if they don't use Air themselves, they can commit the suggestions to pass Air's formatting checks.\n\nNote that this does not run on pushes straight to `main`.\n\n![](./.github/images/format-suggest-example.png)\n\n### Format with `--check`\n\n```r\nusethis::use_github_action(url = \"https://github.com/posit-dev/setup-air/blob/main/examples/format-check.yaml\")\n```\n\nThis runs `air format . --check` on every push to `main` and on every pull request.\nThis is a very simple action that fails if any files would be reformatted.\nWhen this happens, reformat locally using `air format .` or the `Air: Format Workspace Folder` command in VS Code or Positron, and commit and push the results.\n\n## Customization\n\nIn the following subsections, we explore a variety of ways to customize `posit-dev/setup-air`.\n\n### Run arbitrary Air commands\n\n`posit-dev/setup-air` will install Air and add it to the PATH.\nThis means you can call Air in subsequent steps.\n\nThis performs `air format . --check` to ensure that changed code is correctly formatted.\nThe action fails if any changes are required.\n\n``` yaml\n- name: Install\n  uses: posit-dev/setup-air@v1\n\n- name: Check\n  run: air format . --check\n```\n\nThis actually formats the files, rather than performing a check:\n\n``` yaml\n- name: Install\n  uses: posit-dev/setup-air@v1\n\n- name: Format\n  run: air format .\n```\n\nOn a specific directory:\n\n``` yaml\n- name: Install\n  uses: posit-dev/setup-air@v1\n\n- name: Format\n  run: air format ./directory\n```\n\nNote that if you combine this with another action to commit and push these reformatted files back to a branch or pull request, the push will [_not_ retrigger](https://github.com/orgs/community/discussions/25702) any of your GitHub Workflows.\nThis means you won't get any feedback that the push has fixed any broken formatting.\nInstead, we recommend that you either reformat locally and push the changed files back up using a standard commit, or use the `format-suggest.yaml` example that adds suggestion comments to your pull request.\nBoth of these methods will retrigger your checks.\n\n### Install specific versions\n\nBy default this action installs the latest version of Air.\nYou can also request a specific version, or a semver compatible range.\n\n#### Install the latest version\n\n``` yaml\n- name: Install the latest version of Air\n  uses: posit-dev/setup-air@v1\n  with:\n    version: \"latest\"\n```\n\n#### Install a specific version\n\n``` yaml\n- name: Install a specific version of Air\n  uses: posit-dev/setup-air@v1\n  with:\n    version: \"0.4.4\"\n```\n\n#### Install a version by supplying a semver range\n\nYou can specify a [semver range](https://github.com/npm/node-semver?tab=readme-ov-file#ranges) to install the latest version that satisfies the range.\n\n``` yaml\n- name: Install a semver range of Air\n  uses: posit-dev/setup-air@v1\n  with:\n    version: \"\u003e=0.4.0\"\n```\n\n``` yaml\n- name: Pinning a minor version of Air\n  uses: posit-dev/setup-air@v1\n  with:\n    version: \"0.4.x\"\n```\n\n### GitHub authentication token\n\nThis action uses the GitHub API to fetch the Air release artifacts.\nBy default, the `GITHUB_TOKEN` secret is used, which is automatically provided by GitHub Actions.\n\nIf the default [permissions for the GitHub token](https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#permissions-for-the-github_token) are not sufficient, you can provide a custom GitHub token with the necessary permissions.\n\n``` yaml\n- name: Install the latest version of Air with a custom GitHub token\n  uses: posit-dev/setup-air@v1\n  with:\n    github-token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}\n```\n\n## Acknowledgments\n\nThis is a fork of the great [ruff-action](https://github.com/astral-sh/ruff-action).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposit-dev%2Fsetup-air","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposit-dev%2Fsetup-air","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposit-dev%2Fsetup-air/lists"}