├── .github ├── .markdown-link-check.json ├── ISSUE_TEMPLATE │ ├── rename.yml │ ├── release-removal.yml │ ├── feature-request.yml │ ├── bug-report.yml │ └── config.yml ├── workflows │ ├── spell-check.yml │ ├── check-toc.yml │ ├── check-workflows.yml │ ├── assets │ │ └── accesslist.yml │ ├── check-markdown.yml │ ├── check-yaml.yml │ ├── check-license.yml │ ├── sync-labels.yml │ ├── check-prettier-formatting.yml │ └── manage-prs.yml ├── CONTRIBUTING.md ├── label-configuration-files │ └── labels.yml ├── dependabot.yml ├── .markdownlint.yml └── .yamllint.yml ├── LICENSE.txt ├── README.md └── FAQ.md /.github/.markdown-link-check.json: -------------------------------------------------------------------------------- 1 | { 2 | "httpHeaders": [ 3 | { 4 | "urls": ["https://docs.github.com/"], 5 | "headers": { 6 | "Accept-Encoding": "gzip, deflate, br" 7 | } 8 | } 9 | ], 10 | "retryOn429": true, 11 | "retryCount": 3, 12 | "aliveStatusCodes": [200, 206] 13 | } 14 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/rename.yml: -------------------------------------------------------------------------------- 1 | # See: 2 | # https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms 3 | 4 | name: Library name change 5 | description: Request an update of the registered library name. 6 | title: Library name change request 7 | labels: 8 | - "topic: rename" 9 | body: 10 | - type: markdown 11 | attributes: 12 | value: | 13 | Please read the instructions for renaming your library: [here](https://github.com/arduino/library-registry/blob/main/FAQ.md#how-can-i-change-a-librarys-name). 14 | - type: input 15 | id: url 16 | attributes: 17 | label: Library repository URL 18 | validations: 19 | required: true 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/release-removal.yml: -------------------------------------------------------------------------------- 1 | # See: 2 | # https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms 3 | 4 | name: Library release removal 5 | description: Request the removal of a library release. 6 | title: Library release removal request 7 | labels: 8 | - "topic: release removal" 9 | body: 10 | - type: markdown 11 | attributes: 12 | value: | 13 | Please read the instructions for removing a library release: [here](https://github.com/arduino/library-registry/blob/main/FAQ.md#how-can-i-remove-a-release-of-my-library-from-library-manager). 14 | - type: input 15 | id: name 16 | attributes: 17 | label: Library name 18 | validations: 19 | required: true 20 | - type: input 21 | id: version 22 | attributes: 23 | label: Version to remove 24 | validations: 25 | required: true 26 | -------------------------------------------------------------------------------- /.github/workflows/spell-check.yml: -------------------------------------------------------------------------------- 1 | name: Spell Check 2 | 3 | on: 4 | pull_request: 5 | paths-ignore: 6 | - "repositories.txt" 7 | push: 8 | paths-ignore: 9 | - "repositories.txt" 10 | schedule: 11 | # Run every Tuesday at 03:00 UTC to catch breakage caused by updates to the dictionary 12 | - cron: "0 3 * * 2" 13 | workflow_dispatch: 14 | repository_dispatch: 15 | 16 | jobs: 17 | spellcheck: 18 | runs-on: ubuntu-latest 19 | 20 | steps: 21 | - name: Checkout 22 | uses: actions/checkout@v4 23 | 24 | - name: Spell check 25 | uses: codespell-project/actions-codespell@master 26 | with: 27 | # In the event of false positive, add the problematic word, in all lowercase, to a comma-separated list here: 28 | ignore_words_list: "" 29 | builtin: clear,informal,en-GB_to_en-US 30 | check_filenames: true 31 | check_hidden: true 32 | skip: ./.git,./repositories.txt 33 | -------------------------------------------------------------------------------- /.github/workflows/check-toc.yml: -------------------------------------------------------------------------------- 1 | name: Check ToC 2 | 3 | # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows 4 | on: 5 | push: 6 | paths: 7 | - ".github/workflows/check-toc.yml" 8 | - "README.md" 9 | - "FAQ.md" 10 | pull_request: 11 | paths: 12 | - ".github/workflows/check-toc.yml" 13 | - "README.md" 14 | - "FAQ.md" 15 | workflow_dispatch: 16 | repository_dispatch: 17 | 18 | jobs: 19 | check: 20 | name: ${{ matrix.file.name }} 21 | runs-on: ubuntu-latest 22 | 23 | strategy: 24 | fail-fast: false 25 | 26 | matrix: 27 | file: 28 | - name: README.md 29 | # Max ToC depth, for use with the markdown-toc --maxdepth flag. 30 | maxdepth: 4 31 | - name: FAQ.md 32 | maxdepth: 3 33 | 34 | steps: 35 | - name: Checkout repository 36 | uses: actions/checkout@v4 37 | 38 | - name: Install markdown-toc 39 | run: sudo npm install --global markdown-toc 40 | 41 | - name: Rebuild ToC 42 | run: | 43 | markdown-toc \ 44 | --bullets=- \ 45 | --maxdepth=${{ matrix.file.maxdepth }} \ 46 | -i \ 47 | "${{ github.workspace }}/${{ matrix.file.name }}" 48 | 49 | - name: Check ToC 50 | run: git diff --color --exit-code 51 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributor Guide 2 | 3 | Thanks for your interest in contributing to the **Arduino Library Manager Registry**! 4 | 5 | ## Support and Discussion 6 | 7 | If you would like to request assistance or discuss the **Library Manager Registry**, please make a topic on **Arduino Forum**: 8 | 9 | https://forum.arduino.cc/c/17 10 | 11 | ## Registration and Maintenance 12 | 13 | --- 14 | 15 | ⚠ If you behave irresponsibly in your interactions with this repository, your Library Manager Registry privileges will be revoked. 16 | 17 | Carefully read and follow the instructions in any comments the bot and human maintainers make on your pull requests. If you are having trouble following the instructions, add a comment that provides a detailed description of the problem you are having and a human maintainer will provide assistance. 18 | 19 | Although we have set up automation for the most basic tasks, this repository is maintained by humans. So behave in a manner appropriate for interacting with humans, including clearly communicating what you are hoping to accomplish. 20 | 21 | --- 22 | 23 | If you would like to submit a library, or request registry maintenance for a library already in the registry, please follow the instructions provided in the documentation: 24 | 25 | [**Click here to see the documentation**](../README.md#table-of-contents) 26 | 27 | Make sure to read the relevant sections of the FAQ: 28 | 29 | [**Click here to see the FAQ**](../FAQ.md#table-of-contents) 30 | -------------------------------------------------------------------------------- /.github/label-configuration-files/labels.yml: -------------------------------------------------------------------------------- 1 | # Used by the "Sync Labels" workflow 2 | # See: https://github.com/Financial-Times/github-label-sync#label-config-file 3 | 4 | - name: "status: maintenance required" 5 | color: "ff0000" 6 | description: Infrastructure failure unrelated to request 7 | - name: "status: pending backend" 8 | color: "0000ff" 9 | description: Depends on backend maintenance operations 10 | - name: "topic: invalid" 11 | color: "ff0000" 12 | description: Request could not be processed 13 | - name: "topic: modification" 14 | color: "00ffff" 15 | description: Change existing list entry 16 | - name: "topic: other" 17 | color: "00ffff" 18 | description: Something other than a library list request 19 | - name: "topic: release removal" 20 | color: "00ffff" 21 | description: Remove a library release 22 | - name: "topic: removal" 23 | color: "00ffff" 24 | description: Remove library from the list 25 | - name: "topic: rename" 26 | color: "00ffff" 27 | description: Change registered library name 28 | # Vulnerability disclosures are made following the procedure at: 29 | # https://github.com/arduino/.github/blob/master/SECURITY.md 30 | - name: "topic: security" 31 | color: "ff0000" 32 | description: Related to the protection of user data 33 | - name: "topic: submission" 34 | color: "00ffff" 35 | description: Add library to the list 36 | - name: "topic: type change" 37 | color: "00ffff" 38 | description: Change library types data 39 | - name: "topic: URL change" 40 | color: "00ffff" 41 | description: Change library repository URL 42 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.yml: -------------------------------------------------------------------------------- 1 | # Source: 2 | # https://github.com/arduino/tooling-project-assets/blob/main/issue-templates/forms/platform-dependent/bug-report.md 3 | # See: 4 | # https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms 5 | 6 | name: Feature request 7 | description: Suggest an enhancement to this project. 8 | labels: 9 | - "type: enhancement" 10 | body: 11 | - type: textarea 12 | id: description 13 | attributes: 14 | label: Describe the request 15 | validations: 16 | required: true 17 | - type: textarea 18 | id: current 19 | attributes: 20 | label: Describe the current behavior 21 | description: | 22 | What is the current behavior of the Arduino Library Manager registry in relation to your request? 23 | How can we reproduce that behavior? 24 | validations: 25 | required: true 26 | - type: textarea 27 | id: additional 28 | attributes: 29 | label: Additional context 30 | description: Add any additional information here. 31 | validations: 32 | required: false 33 | - type: checkboxes 34 | id: checklist 35 | attributes: 36 | label: Issue checklist 37 | description: Please double-check that you have done each of the following things before submitting the issue. 38 | options: 39 | - label: I searched for previous requests in [the issue tracker](https://github.com/arduino/library-registry/issues?q=) 40 | required: true 41 | - label: My request contains all necessary details 42 | required: true 43 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # See: https://docs.github.com/en/code-security/supply-chain-security/configuration-options-for-dependency-updates#about-the-dependabotyml-file 2 | version: 2 3 | 4 | updates: 5 | # Configure check for outdated GitHub Actions actions in workflows. 6 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/dependabot/README.md 7 | # See: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-actions-up-to-date-with-dependabot 8 | - package-ecosystem: github-actions 9 | directory: / # Check the repository's workflows under /.github/workflows/ 10 | assignees: 11 | - per1234 12 | open-pull-requests-limit: 100 13 | schedule: 14 | interval: daily 15 | labels: 16 | - "topic: infrastructure" 17 | - package-ecosystem: github-actions 18 | target-branch: production 19 | directory: / 20 | assignees: 21 | - per1234 22 | open-pull-requests-limit: 100 23 | schedule: 24 | interval: daily 25 | labels: 26 | - "topic: infrastructure" 27 | - package-ecosystem: gomod 28 | target-branch: production 29 | directory: /.github/workflows/assets/validate-registry/ 30 | assignees: 31 | - per1234 32 | open-pull-requests-limit: 100 33 | schedule: 34 | interval: daily 35 | labels: 36 | - "topic: infrastructure" 37 | - package-ecosystem: pip 38 | target-branch: production 39 | directory: / 40 | assignees: 41 | - per1234 42 | open-pull-requests-limit: 100 43 | schedule: 44 | interval: daily 45 | labels: 46 | - "topic: infrastructure" 47 | -------------------------------------------------------------------------------- /.github/workflows/check-workflows.yml: -------------------------------------------------------------------------------- 1 | name: Check Workflows 2 | 3 | # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows 4 | on: 5 | push: 6 | paths: 7 | - ".github/workflows/*.yaml" 8 | - ".github/workflows/*.yml" 9 | pull_request: 10 | paths: 11 | - ".github/workflows/*.yaml" 12 | - ".github/workflows/*.yml" 13 | schedule: 14 | # Run every Tuesday at 8 AM UTC to catch breakage resulting from changes to the JSON schema. 15 | - cron: "0 8 * * TUE" 16 | workflow_dispatch: 17 | repository_dispatch: 18 | 19 | jobs: 20 | validate: 21 | runs-on: ubuntu-latest 22 | 23 | steps: 24 | - name: Checkout repository 25 | uses: actions/checkout@v4 26 | 27 | - name: Download JSON schema for GitHub Actions workflows 28 | id: download-schema 29 | uses: carlosperate/download-file-action@v2 30 | with: 31 | # See: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/github-workflow.json 32 | file-url: https://json.schemastore.org/github-workflow 33 | location: ${{ runner.temp }}/github-workflow-schema 34 | file-name: github-workflow.json 35 | 36 | - name: Install JSON schema validator 37 | run: sudo npm install --global ajv-cli 38 | 39 | - name: Validate GitHub Actions workflows 40 | run: | 41 | # See: https://github.com/ajv-validator/ajv-cli#readme 42 | ajv validate \ 43 | --strict=false \ 44 | -s "${{ steps.download-schema.outputs.file-path }}" \ 45 | -d "./.github/workflows/*.{yml,yaml}" 46 | -------------------------------------------------------------------------------- /.github/.markdownlint.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown/.markdownlint.yml 2 | # See: https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md 3 | # The code style defined in this file is the official standardized style to be used in all Arduino projects and should 4 | # not be modified. 5 | # Note: Rules disabled solely because they are redundant to Prettier are marked with a "Prettier" comment. 6 | 7 | default: false 8 | MD001: false 9 | MD002: false 10 | MD003: false # Prettier 11 | MD004: false # Prettier 12 | MD005: false # Prettier 13 | MD006: false # Prettier 14 | MD007: false # Prettier 15 | MD008: false # Prettier 16 | MD009: 17 | br_spaces: 0 18 | strict: true 19 | list_item_empty_lines: false # Prettier 20 | MD010: false # Prettier 21 | MD011: true 22 | MD012: false # Prettier 23 | MD013: false 24 | MD014: false 25 | MD018: true 26 | MD019: false # Prettier 27 | MD020: true 28 | MD021: false # Prettier 29 | MD022: false # Prettier 30 | MD023: false # Prettier 31 | MD024: false 32 | MD025: 33 | level: 1 34 | front_matter_title: '^\s*"?title"?\s*[:=]' 35 | MD026: false 36 | MD027: false # Prettier 37 | MD028: false 38 | MD029: 39 | style: one 40 | MD030: 41 | ul_single: 1 42 | ol_single: 1 43 | ul_multi: 1 44 | ol_multi: 1 45 | MD031: false # Prettier 46 | MD032: false # Prettier 47 | MD033: false 48 | MD034: false 49 | MD035: false # Prettier 50 | MD036: false 51 | MD037: true 52 | MD038: true 53 | MD039: true 54 | MD040: false 55 | MD041: false 56 | MD042: true 57 | MD043: false 58 | MD044: false 59 | MD045: true 60 | MD046: 61 | style: fenced 62 | MD047: false # Prettier 63 | -------------------------------------------------------------------------------- /.github/workflows/assets/accesslist.yml: -------------------------------------------------------------------------------- 1 | # Access control for the Arduino Library Manager registry. 2 | # This file is used by https://github.com/arduino/library-registry-submission-parser, via the "Manage PRs" workflow. 3 | 4 | # Allowlist 5 | - host: github.com 6 | name: per1234 7 | access: allow 8 | reference: 9 | 10 | # Denylist 11 | - host: github.com 12 | name: 7Semi 13 | access: deny 14 | reference: https://github.com/arduino/library-registry/pull/5734#pullrequestreview-2548818476 15 | - host: github.com 16 | name: ajangrahmat 17 | access: deny 18 | reference: https://github.com/arduino/library-registry/pull/5706#issuecomment-2588923290 19 | - host: github.com 20 | name: brincode 21 | access: deny 22 | reference: https://github.com/arduino/library-registry/pull/4460#issuecomment-2589062464 23 | - host: github.com 24 | name: DefHam140 25 | access: deny 26 | reference: https://github.com/arduino/library-registry/pull/5265#issuecomment-2589039572 27 | - host: github.com 28 | name: ErlTechnologies 29 | access: deny 30 | reference: https://github.com/arduino/library-registry/pull/4873#issuecomment-2589138298 31 | - host: github.com 32 | name: kelasrobot 33 | access: deny 34 | reference: https://github.com/arduino/library-registry/pull/5706#issuecomment-2588923290 35 | - host: github.com 36 | name: Subodh-roy2 37 | access: deny 38 | reference: https://github.com/arduino/library-registry/pull/4422#issuecomment-2589051618 39 | - host: github.com 40 | name: vpbharath 41 | access: deny 42 | reference: https://github.com/arduino/library-registry/pull/4873#issuecomment-2589138298 43 | - host: github.com 44 | name: YoavPaz 45 | access: deny 46 | reference: https://github.com/arduino/library-registry/pull/5741#issuecomment-2589016403 47 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.yml: -------------------------------------------------------------------------------- 1 | # Source: 2 | # https://github.com/arduino/tooling-project-assets/blob/main/issue-templates/forms/platform-dependent/bug-report.md 3 | # See: 4 | # https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms 5 | 6 | name: Bug report 7 | description: Report a problem with the code or documentation in this repository. 8 | labels: 9 | - "type: imperfection" 10 | body: 11 | - type: textarea 12 | id: description 13 | attributes: 14 | label: Describe the problem 15 | validations: 16 | required: true 17 | - type: textarea 18 | id: reproduce 19 | attributes: 20 | label: To reproduce 21 | description: Provide the specific set of steps we can follow to reproduce the problem. 22 | validations: 23 | required: true 24 | - type: textarea 25 | id: expected 26 | attributes: 27 | label: Expected behavior 28 | description: What would you expect to happen after following those instructions? 29 | validations: 30 | required: true 31 | - type: textarea 32 | id: additional 33 | attributes: 34 | label: Additional context 35 | description: Add any additional information here. 36 | validations: 37 | required: false 38 | - type: checkboxes 39 | id: checklist 40 | attributes: 41 | label: Issue checklist 42 | description: Please double-check that you have done each of the following things before submitting the issue. 43 | options: 44 | - label: I searched for previous reports in [the issue tracker](https://github.com/arduino/library-registry/issues?q=) 45 | required: true 46 | - label: My report contains all necessary details 47 | required: true 48 | -------------------------------------------------------------------------------- /.github/workflows/check-markdown.yml: -------------------------------------------------------------------------------- 1 | name: Check Markdown 2 | 3 | # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows 4 | on: 5 | push: 6 | paths: 7 | - ".github/workflows/check-markdown.yml" 8 | - ".github/.markdown-link-check.json" 9 | - "**/.markdownlint*" 10 | - "**.md" 11 | - "**.mdx" 12 | - "**.mkdn" 13 | - "**.mdown" 14 | - "**.markdown" 15 | pull_request: 16 | paths: 17 | - ".github/workflows/check-markdown.yml" 18 | - ".github/.markdown-link-check.json" 19 | - "**/.markdownlint*" 20 | - "**.md" 21 | - "**.mdx" 22 | - "**.mkdn" 23 | - "**.mdown" 24 | - "**.markdown" 25 | schedule: 26 | # Run every Tuesday at 8 AM UTC to catch breakage caused by changes to markdownlint. 27 | - cron: "0 8 * * TUE" 28 | workflow_dispatch: 29 | repository_dispatch: 30 | 31 | jobs: 32 | lint: 33 | runs-on: ubuntu-latest 34 | 35 | steps: 36 | - name: Checkout repository 37 | uses: actions/checkout@v4 38 | 39 | - name: Initialize markdownlint-cli problem matcher 40 | uses: xt0rted/markdownlint-problem-matcher@v3 41 | 42 | - name: Install markdownlint-cli 43 | run: sudo npm install --global markdownlint-cli 44 | 45 | - name: Run markdownlint 46 | run: markdownlint --config "${{ github.workspace }}/.github/.markdownlint.yml" "**/*.md" 47 | 48 | links: 49 | runs-on: ubuntu-latest 50 | 51 | steps: 52 | - name: Checkout repository 53 | uses: actions/checkout@v4 54 | 55 | - name: Determine whether only modified files should be checked 56 | id: check-modified 57 | if: github.event_name == 'pull_request' 58 | run: | 59 | echo "::set-output name=value::yes" 60 | 61 | - name: Check links 62 | uses: gaurav-nelson/github-action-markdown-link-check@v1 63 | with: 64 | config-file: .github/.markdown-link-check.json 65 | use-quiet-mode: "yes" 66 | check-modified-files-only: ${{ steps.check-modified.outputs.value }} 67 | base-branch: ${{ github.base_ref }} 68 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | # Source: 2 | # https://github.com/arduino/tooling-project-assets/blob/main/issue-templates/template-choosers/general/config.yml 3 | # See: 4 | # https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser 5 | 6 | contact_links: 7 | - name: Submit a library 8 | url: https://github.com/arduino/library-registry#adding-a-library-to-library-manager 9 | about: Instructions for submitting a library for inclusion in the Arduino Library Manager. 10 | - name: Change the library URL 11 | url: https://github.com/arduino/library-registry#changing-the-url-of-a-library-already-in-library-manager 12 | about: Instructions for updating a library's registered URL. 13 | - name: Library removal 14 | url: https://github.com/arduino/library-registry#removing-a-library-from-library-manager 15 | about: Instructions for requesting removal of your library from the Arduino Library Manager index. 16 | - name: Submissions of new library releases 17 | url: https://github.com/arduino/library-registry/blob/main/FAQ.md#how-can-i-publish-a-new-release-once-my-library-is-in-the-list 18 | about: Instructions for publishing a new release of your library. 19 | - name: Library not updated after release 20 | url: https://github.com/arduino/library-registry/blob/main/FAQ.md#why-arent-releases-of-my-library-being-picked-up-by-library-manager 21 | about: Information on why library releases are not picked up. 22 | - name: Learn about using the Arduino Library Manager 23 | url: https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries/#using-the-library-manager 24 | about: Documentation is available here. 25 | - name: Learn about using this project 26 | url: https://github.com/arduino/library-registry#readme 27 | about: Detailed usage documentation is available here. 28 | - name: Support request 29 | url: https://forum.arduino.cc/ 30 | about: We can help you out on the Arduino Forum! 31 | - name: Discuss development work on the project 32 | url: https://groups.google.com/a/arduino.cc/g/developers 33 | about: Arduino Developers Mailing List 34 | -------------------------------------------------------------------------------- /.github/.yamllint.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-yaml/.yamllint.yml 2 | # See: https://yamllint.readthedocs.io/en/stable/configuration.html 3 | # The code style defined in this file is the official standardized style to be used in all Arduino tooling projects and 4 | # should not be modified. 5 | # Note: Rules disabled solely because they are redundant to Prettier are marked with a "Prettier" comment. 6 | 7 | rules: 8 | braces: 9 | level: error 10 | forbid: non-empty 11 | min-spaces-inside: -1 # Prettier 12 | max-spaces-inside: -1 # Prettier 13 | min-spaces-inside-empty: -1 # Prettier 14 | max-spaces-inside-empty: -1 # Prettier 15 | brackets: 16 | level: error 17 | forbid: non-empty 18 | min-spaces-inside: -1 # Prettier 19 | max-spaces-inside: -1 # Prettier 20 | min-spaces-inside-empty: -1 # Prettier 21 | max-spaces-inside-empty: -1 # Prettier 22 | colons: disable # Prettier 23 | commas: disable # Prettier 24 | comments: disable # Prettier 25 | comments-indentation: disable # Prettier 26 | document-end: disable # Prettier 27 | document-start: disable 28 | empty-lines: disable # Prettier 29 | empty-values: disable 30 | hyphens: disable # Prettier 31 | indentation: disable # Prettier 32 | key-duplicates: disable # Prettier 33 | key-ordering: disable 34 | line-length: 35 | level: warning 36 | max: 120 37 | allow-non-breakable-words: true 38 | allow-non-breakable-inline-mappings: true 39 | new-line-at-end-of-file: disable # Prettier 40 | new-lines: disable # Prettier 41 | octal-values: 42 | level: warning 43 | forbid-implicit-octal: true 44 | forbid-explicit-octal: false 45 | quoted-strings: disable 46 | trailing-spaces: disable # Prettier 47 | truthy: 48 | level: error 49 | allowed-values: 50 | - "true" 51 | - "false" 52 | - "on" # Used by GitHub Actions as a workflow key. 53 | check-keys: true 54 | 55 | yaml-files: 56 | # Source: https://github.com/ikatyang/linguist-languages/blob/master/data/YAML.json (used by Prettier) 57 | - ".clang-format" 58 | - ".clang-tidy" 59 | - ".gemrc" 60 | - ".yamllint" 61 | - "glide.lock" 62 | - "*.yml" 63 | - "*.mir" 64 | - "*.reek" 65 | - "*.rviz" 66 | - "*.sublime-syntax" 67 | - "*.syntax" 68 | - "*.yaml" 69 | - "*.yaml-tmlanguage" 70 | - "*.yaml.sed" 71 | - "*.yml.mysql" 72 | 73 | ignore: | 74 | /.git/ 75 | -------------------------------------------------------------------------------- /.github/workflows/check-yaml.yml: -------------------------------------------------------------------------------- 1 | name: Check YAML 2 | 3 | # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows 4 | on: 5 | push: 6 | paths: 7 | - ".github/workflows/check-yaml.yml" 8 | - ".yamllint*" 9 | # Source: https://github.com/ikatyang/linguist-languages/blob/master/data/YAML.json (used by Prettier) 10 | - "**/.clang-format" 11 | - "**/.clang-tidy" 12 | - "**/.gemrc" 13 | - "**/glide.lock" 14 | - "**.yml" 15 | - "**.mir" 16 | - "**.reek" 17 | - "**.rviz" 18 | - "**.sublime-syntax" 19 | - "**.syntax" 20 | - "**.yaml" 21 | - "**.yaml-tmlanguage" 22 | - "**.yaml.sed" 23 | - "**.yml.mysql" 24 | pull_request: 25 | paths: 26 | - ".github/workflows/check-yaml.yml" 27 | - ".yamllint*" 28 | - "**/.clang-format" 29 | - "**/.clang-tidy" 30 | - "**/.gemrc" 31 | - "**/glide.lock" 32 | - "**.yml" 33 | - "**.mir" 34 | - "**.reek" 35 | - "**.rviz" 36 | - "**.sublime-syntax" 37 | - "**.syntax" 38 | - "**.yaml" 39 | - "**.yaml-tmlanguage" 40 | - "**.yaml.sed" 41 | - "**.yml.mysql" 42 | schedule: 43 | # Run every Tuesday at 8 AM UTC to catch breakage caused by changes to yamllint. 44 | - cron: "0 8 * * TUE" 45 | workflow_dispatch: 46 | repository_dispatch: 47 | 48 | jobs: 49 | check: 50 | name: ${{ matrix.configuration.name }} 51 | runs-on: ubuntu-latest 52 | 53 | strategy: 54 | fail-fast: false 55 | 56 | matrix: 57 | configuration: 58 | - name: Generate problem matcher output 59 | # yamllint's "github" output type produces annotated diffs, but is not useful to humans reading the log. 60 | format: github 61 | # The other matrix job is used to set the result, so this job is configured to always pass. 62 | continue-on-error: true 63 | - name: Check formatting 64 | # yamllint's "colored" output type is most suitable for humans reading the log. 65 | format: colored 66 | continue-on-error: false 67 | 68 | steps: 69 | - name: Checkout repository 70 | uses: actions/checkout@v4 71 | 72 | - name: Check YAML 73 | continue-on-error: ${{ matrix.configuration.continue-on-error }} 74 | run: | 75 | yamllint \ 76 | --config-file "${{ github.workspace }}/.github/.yamllint.yml" \ 77 | --format ${{ matrix.configuration.format }} \ 78 | . 79 | -------------------------------------------------------------------------------- /.github/workflows/check-license.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-license.md 2 | name: Check License 3 | 4 | env: 5 | EXPECTED_LICENSE_FILENAME: LICENSE.txt 6 | # SPDX identifier: https://spdx.org/licenses/ 7 | EXPECTED_LICENSE_TYPE: CC0-1.0 8 | 9 | # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows 10 | on: 11 | push: 12 | paths: 13 | - ".github/workflows/check-license.ya?ml" 14 | # See: https://github.com/licensee/licensee/blob/master/docs/what-we-look-at.md#detecting-the-license-file 15 | - "[cC][oO][pP][yY][iI][nN][gG]*" 16 | - "[cC][oO][pP][yY][rR][iI][gG][hH][tH]*" 17 | - "[lL][iI][cC][eE][nN][cCsS][eE]*" 18 | - "[oO][fF][lL]*" 19 | - "[pP][aA][tT][eE][nN][tT][sS]*" 20 | pull_request: 21 | paths: 22 | - ".github/workflows/check-license.ya?ml" 23 | - "[cC][oO][pP][yY][iI][nN][gG]*" 24 | - "[cC][oO][pP][yY][rR][iI][gG][hH][tH]*" 25 | - "[lL][iI][cC][eE][nN][cCsS][eE]*" 26 | - "[oO][fF][lL]*" 27 | - "[pP][aA][tT][eE][nN][tT][sS]*" 28 | workflow_dispatch: 29 | repository_dispatch: 30 | 31 | jobs: 32 | check-license: 33 | runs-on: ubuntu-latest 34 | 35 | steps: 36 | - name: Checkout repository 37 | uses: actions/checkout@v4 38 | 39 | - name: Install Ruby 40 | uses: ruby/setup-ruby@v1 41 | with: 42 | ruby-version: ruby # Install latest version 43 | 44 | - name: Install licensee 45 | run: gem install licensee 46 | 47 | - name: Check license file 48 | run: | 49 | EXIT_STATUS=0 50 | # See: https://github.com/licensee/licensee 51 | LICENSEE_OUTPUT="$(licensee detect --json --confidence=100)" 52 | 53 | DETECTED_LICENSE_FILE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].filename | tr --delete '\r')" 54 | echo "Detected license file: $DETECTED_LICENSE_FILE" 55 | if [ "$DETECTED_LICENSE_FILE" != "\"${EXPECTED_LICENSE_FILENAME}\"" ]; then 56 | echo "::error file=${DETECTED_LICENSE_FILE}::detected license file $DETECTED_LICENSE_FILE doesn't match expected: $EXPECTED_LICENSE_FILENAME" 57 | EXIT_STATUS=1 58 | fi 59 | 60 | DETECTED_LICENSE_TYPE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].matched_license | tr --delete '\r')" 61 | echo "Detected license type: $DETECTED_LICENSE_TYPE" 62 | if [ "$DETECTED_LICENSE_TYPE" != "\"${EXPECTED_LICENSE_TYPE}\"" ]; then 63 | echo "::error file=${DETECTED_LICENSE_FILE}::detected license type $DETECTED_LICENSE_TYPE doesn't match expected \"${EXPECTED_LICENSE_TYPE}\"" 64 | EXIT_STATUS=1 65 | fi 66 | 67 | exit $EXIT_STATUS 68 | -------------------------------------------------------------------------------- /.github/workflows/sync-labels.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/sync-labels.md 2 | name: Sync Labels 3 | 4 | # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows 5 | on: 6 | push: 7 | paths: 8 | - ".github/workflows/sync-labels.ya?ml" 9 | - ".github/label-configuration-files/*.ya?ml" 10 | pull_request: 11 | paths: 12 | - ".github/workflows/sync-labels.ya?ml" 13 | - ".github/label-configuration-files/*.ya?ml" 14 | schedule: 15 | # Run daily at 8 AM UTC to sync with changes to shared label configurations. 16 | - cron: "0 8 * * *" 17 | workflow_dispatch: 18 | repository_dispatch: 19 | 20 | env: 21 | CONFIGURATIONS_FOLDER: .github/label-configuration-files 22 | CONFIGURATIONS_ARTIFACT_PREFIX: label-configuration-file- 23 | 24 | jobs: 25 | check: 26 | runs-on: ubuntu-latest 27 | 28 | steps: 29 | - name: Checkout repository 30 | uses: actions/checkout@v4 31 | 32 | - name: Download JSON schema for labels configuration file 33 | id: download-schema 34 | uses: carlosperate/download-file-action@v2 35 | with: 36 | file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json 37 | location: ${{ runner.temp }}/label-configuration-schema 38 | 39 | - name: Install JSON schema validator 40 | run: | 41 | sudo npm install \ 42 | --global \ 43 | ajv-cli \ 44 | ajv-formats 45 | 46 | - name: Validate local labels configuration 47 | run: | 48 | # See: https://github.com/ajv-validator/ajv-cli#readme 49 | ajv validate \ 50 | --all-errors \ 51 | -c ajv-formats \ 52 | -s "${{ steps.download-schema.outputs.file-path }}" \ 53 | -d "${{ env.CONFIGURATIONS_FOLDER }}/*.{yml,yaml}" 54 | 55 | download: 56 | needs: check 57 | runs-on: ubuntu-latest 58 | 59 | strategy: 60 | matrix: 61 | filename: 62 | # Filenames of the shared configurations to apply to the repository in addition to the local configuration. 63 | # https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/sync-labels 64 | - universal.yml 65 | 66 | steps: 67 | - name: Download 68 | uses: carlosperate/download-file-action@v2 69 | with: 70 | file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} 71 | 72 | - name: Pass configuration files to next job via workflow artifact 73 | uses: actions/upload-artifact@v4 74 | with: 75 | path: | 76 | *.yaml 77 | *.yml 78 | if-no-files-found: error 79 | name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}${{ matrix.filename }} 80 | 81 | sync: 82 | needs: download 83 | runs-on: ubuntu-latest 84 | 85 | steps: 86 | - name: Set environment variables 87 | run: | 88 | # See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable 89 | echo "MERGED_CONFIGURATION_PATH=${{ runner.temp }}/labels.yml" >> "$GITHUB_ENV" 90 | 91 | - name: Determine whether to dry run 92 | id: dry-run 93 | if: > 94 | github.event_name == 'pull_request' || 95 | ( 96 | ( 97 | github.event_name == 'push' || 98 | github.event_name == 'workflow_dispatch' 99 | ) && 100 | github.ref != format('refs/heads/{0}', github.event.repository.default_branch) 101 | ) 102 | run: | 103 | # Use of this flag in the github-label-sync command will cause it to only check the validity of the 104 | # configuration. 105 | echo "::set-output name=flag::--dry-run" 106 | 107 | - name: Checkout repository 108 | uses: actions/checkout@v4 109 | 110 | - name: Download configuration file artifacts 111 | uses: actions/download-artifact@v4 112 | with: 113 | merge-multiple: true 114 | pattern: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}* 115 | path: ${{ env.CONFIGURATIONS_FOLDER }} 116 | 117 | - name: Remove unneeded artifacts 118 | uses: geekyeggo/delete-artifact@v5 119 | with: 120 | name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}* 121 | 122 | - name: Merge label configuration files 123 | run: | 124 | # Merge all configuration files 125 | shopt -s extglob 126 | cat "${{ env.CONFIGURATIONS_FOLDER }}"/*.@(yml|yaml) > "${{ env.MERGED_CONFIGURATION_PATH }}" 127 | 128 | - name: Install github-label-sync 129 | run: sudo npm install --global github-label-sync 130 | 131 | - name: Sync labels 132 | env: 133 | GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} 134 | run: | 135 | # See: https://github.com/Financial-Times/github-label-sync 136 | github-label-sync \ 137 | --labels "${{ env.MERGED_CONFIGURATION_PATH }}" \ 138 | ${{ steps.dry-run.outputs.flag }} \ 139 | ${{ github.repository }} 140 | -------------------------------------------------------------------------------- /.github/workflows/check-prettier-formatting.yml: -------------------------------------------------------------------------------- 1 | name: Check Prettier Formatting 2 | 3 | # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows 4 | on: 5 | push: 6 | paths: 7 | - ".github/workflows/check-prettier-formatting.yml" 8 | - "**/.prettierignore" 9 | - "**/.prettierrc*" 10 | # CSS 11 | - "**.css" 12 | - "**.wxss" 13 | # PostCSS 14 | - "**.pcss" 15 | - "**.postcss" 16 | # Less 17 | - "**.less" 18 | # SCSS 19 | - "**.scss" 20 | # GraphQL 21 | - "**.graphqls?" 22 | - "**.gql" 23 | # handlebars 24 | - "**.handlebars" 25 | - "**.hbs" 26 | # HTML 27 | - "**.mjml" 28 | - "**.html?" 29 | - "**.html.hl" 30 | - "**.st" 31 | - "**.xht" 32 | - "**.xhtml" 33 | # Vue 34 | - "**.vue" 35 | # JavaScript 36 | - "**.flow" 37 | - "**._?jsb?" 38 | - "**.bones" 39 | - "**.cjs" 40 | - "**.es6?" 41 | - "**.frag" 42 | - "**.gs" 43 | - "**.jake" 44 | - "**.jscad" 45 | - "**.jsfl" 46 | - "**.js[ms]" 47 | - "**.[mn]js" 48 | - "**.pac" 49 | - "**.wxs" 50 | - "**.[xs]s?js" 51 | - "**.xsjslib" 52 | # JSX 53 | - "**.jsx" 54 | # TypeScript 55 | - "**.ts" 56 | # TSX 57 | - "**.tsx" 58 | # JSON 59 | - "**/.eslintrc" 60 | - "**.json" 61 | - "**.avsc" 62 | - "**.geojson" 63 | - "**.gltf" 64 | - "**.har" 65 | - "**.ice" 66 | - "**.JSON-tmLanguage" 67 | - "**.mcmeta" 68 | - "**.tfstate" 69 | - "**.topojson" 70 | - "**.webapp" 71 | - "**.webmanifest" 72 | - "**.yyp?" 73 | # JSONC 74 | - "**/.babelrc" 75 | - "**/.jscsrc" 76 | - "**/.js[hl]intrc" 77 | - "**.jsonc" 78 | - "**.sublime-*" 79 | # JSON5 80 | - "**.json5" 81 | # Markdown 82 | - "**.mdx?" 83 | - "**.markdown" 84 | - "**.mk?down" 85 | - "**.mdwn" 86 | - "**.mkdn?" 87 | - "**.ronn" 88 | - "**.workbook" 89 | # YAML 90 | - "**/.clang-format" 91 | - "**/.clang-tidy" 92 | - "**/.gemrc" 93 | - "**/glide.lock" 94 | - "**.yml" 95 | - "**.mir" 96 | - "**.reek" 97 | - "**.rviz" 98 | - "**.sublime-syntax" 99 | - "**.syntax" 100 | - "**.yaml" 101 | - "**.yaml-tmlanguage" 102 | - "**.yaml.sed" 103 | - "**.yml.mysql" 104 | pull_request: 105 | paths: 106 | - ".github/workflows/check-prettier-formatting.yml" 107 | - "**/.prettierignore" 108 | - "**/.prettierrc*" 109 | # CSS 110 | - "**.css" 111 | - "**.wxss" 112 | # PostCSS 113 | - "**.pcss" 114 | - "**.postcss" 115 | # Less 116 | - "**.less" 117 | # SCSS 118 | - "**.scss" 119 | # GraphQL 120 | - "**.graphqls?" 121 | - "**.gql" 122 | # handlebars 123 | - "**.handlebars" 124 | - "**.hbs" 125 | # HTML 126 | - "**.mjml" 127 | - "**.html?" 128 | - "**.html.hl" 129 | - "**.st" 130 | - "**.xht" 131 | - "**.xhtml" 132 | # Vue 133 | - "**.vue" 134 | # JavaScript 135 | - "**.flow" 136 | - "**._?jsb?" 137 | - "**.bones" 138 | - "**.cjs" 139 | - "**.es6?" 140 | - "**.frag" 141 | - "**.gs" 142 | - "**.jake" 143 | - "**.jscad" 144 | - "**.jsfl" 145 | - "**.js[ms]" 146 | - "**.[mn]js" 147 | - "**.pac" 148 | - "**.wxs" 149 | - "**.[xs]s?js" 150 | - "**.xsjslib" 151 | # JSX 152 | - "**.jsx" 153 | # TypeScript 154 | - "**.ts" 155 | # TSX 156 | - "**.tsx" 157 | # JSON 158 | - "**/.eslintrc" 159 | - "**.json" 160 | - "**.avsc" 161 | - "**.geojson" 162 | - "**.gltf" 163 | - "**.har" 164 | - "**.ice" 165 | - "**.JSON-tmLanguage" 166 | - "**.mcmeta" 167 | - "**.tfstate" 168 | - "**.topojson" 169 | - "**.webapp" 170 | - "**.webmanifest" 171 | - "**.yyp?" 172 | # JSONC 173 | - "**/.babelrc" 174 | - "**/.jscsrc" 175 | - "**/.js[hl]intrc" 176 | - "**.jsonc" 177 | - "**.sublime-*" 178 | # JSON5 179 | - "**.json5" 180 | # Markdown 181 | - "**.mdx?" 182 | - "**.markdown" 183 | - "**.mk?down" 184 | - "**.mdwn" 185 | - "**.mkdn?" 186 | - "**.ronn" 187 | - "**.workbook" 188 | # YAML 189 | - "**/.clang-format" 190 | - "**/.clang-tidy" 191 | - "**/.gemrc" 192 | - "**/glide.lock" 193 | - "**.yml" 194 | - "**.mir" 195 | - "**.reek" 196 | - "**.rviz" 197 | - "**.sublime-syntax" 198 | - "**.syntax" 199 | - "**.yaml" 200 | - "**.yaml-tmlanguage" 201 | - "**.yaml.sed" 202 | - "**.yml.mysql" 203 | schedule: 204 | # Run every Tuesday at 8 AM UTC to catch breakage caused by changes to Prettier. 205 | - cron: "0 8 * * TUE" 206 | workflow_dispatch: 207 | repository_dispatch: 208 | 209 | jobs: 210 | check: 211 | runs-on: ubuntu-latest 212 | 213 | steps: 214 | - name: Checkout repository 215 | uses: actions/checkout@v4 216 | 217 | - name: Install Prettier 218 | run: sudo npm install --global prettier 219 | 220 | - name: Format with Prettier 221 | run: prettier --write . 222 | 223 | - name: Check formatting 224 | run: git diff --color --exit-code 225 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Creative Commons Legal Code 2 | 3 | CC0 1.0 Universal 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN 7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS 10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM 11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED 12 | HEREUNDER. 13 | 14 | Statement of Purpose 15 | 16 | The laws of most jurisdictions throughout the world automatically confer 17 | exclusive Copyright and Related Rights (defined below) upon the creator 18 | and subsequent owner(s) (each and all, an "owner") of an original work of 19 | authorship and/or a database (each, a "Work"). 20 | 21 | Certain owners wish to permanently relinquish those rights to a Work for 22 | the purpose of contributing to a commons of creative, cultural and 23 | scientific works ("Commons") that the public can reliably and without fear 24 | of later claims of infringement build upon, modify, incorporate in other 25 | works, reuse and redistribute as freely as possible in any form whatsoever 26 | and for any purposes, including without limitation commercial purposes. 27 | These owners may contribute to the Commons to promote the ideal of a free 28 | culture and the further production of creative, cultural and scientific 29 | works, or to gain reputation or greater distribution for their Work in 30 | part through the use and efforts of others. 31 | 32 | For these and/or other purposes and motivations, and without any 33 | expectation of additional consideration or compensation, the person 34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she 35 | is an owner of Copyright and Related Rights in the Work, voluntarily 36 | elects to apply CC0 to the Work and publicly distribute the Work under its 37 | terms, with knowledge of his or her Copyright and Related Rights in the 38 | Work and the meaning and intended legal effect of CC0 on those rights. 39 | 40 | 1. Copyright and Related Rights. A Work made available under CC0 may be 41 | protected by copyright and related or neighboring rights ("Copyright and 42 | Related Rights"). Copyright and Related Rights include, but are not 43 | limited to, the following: 44 | 45 | i. the right to reproduce, adapt, distribute, perform, display, 46 | communicate, and translate a Work; 47 | ii. moral rights retained by the original author(s) and/or performer(s); 48 | iii. publicity and privacy rights pertaining to a person's image or 49 | likeness depicted in a Work; 50 | iv. rights protecting against unfair competition in regards to a Work, 51 | subject to the limitations in paragraph 4(a), below; 52 | v. rights protecting the extraction, dissemination, use and reuse of data 53 | in a Work; 54 | vi. database rights (such as those arising under Directive 96/9/EC of the 55 | European Parliament and of the Council of 11 March 1996 on the legal 56 | protection of databases, and under any national implementation 57 | thereof, including any amended or successor version of such 58 | directive); and 59 | vii. other similar, equivalent or corresponding rights throughout the 60 | world based on applicable law or treaty, and any national 61 | implementations thereof. 62 | 63 | 2. Waiver. To the greatest extent permitted by, but not in contravention 64 | of, applicable law, Affirmer hereby overtly, fully, permanently, 65 | irrevocably and unconditionally waives, abandons, and surrenders all of 66 | Affirmer's Copyright and Related Rights and associated claims and causes 67 | of action, whether now known or unknown (including existing as well as 68 | future claims and causes of action), in the Work (i) in all territories 69 | worldwide, (ii) for the maximum duration provided by applicable law or 70 | treaty (including future time extensions), (iii) in any current or future 71 | medium and for any number of copies, and (iv) for any purpose whatsoever, 72 | including without limitation commercial, advertising or promotional 73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each 74 | member of the public at large and to the detriment of Affirmer's heirs and 75 | successors, fully intending that such Waiver shall not be subject to 76 | revocation, rescission, cancellation, termination, or any other legal or 77 | equitable action to disrupt the quiet enjoyment of the Work by the public 78 | as contemplated by Affirmer's express Statement of Purpose. 79 | 80 | 3. Public License Fallback. Should any part of the Waiver for any reason 81 | be judged legally invalid or ineffective under applicable law, then the 82 | Waiver shall be preserved to the maximum extent permitted taking into 83 | account Affirmer's express Statement of Purpose. In addition, to the 84 | extent the Waiver is so judged Affirmer hereby grants to each affected 85 | person a royalty-free, non transferable, non sublicensable, non exclusive, 86 | irrevocable and unconditional license to exercise Affirmer's Copyright and 87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the 88 | maximum duration provided by applicable law or treaty (including future 89 | time extensions), (iii) in any current or future medium and for any number 90 | of copies, and (iv) for any purpose whatsoever, including without 91 | limitation commercial, advertising or promotional purposes (the 92 | "License"). The License shall be deemed effective as of the date CC0 was 93 | applied by Affirmer to the Work. Should any part of the License for any 94 | reason be judged legally invalid or ineffective under applicable law, such 95 | partial invalidity or ineffectiveness shall not invalidate the remainder 96 | of the License, and in such case Affirmer hereby affirms that he or she 97 | will not (i) exercise any of his or her remaining Copyright and Related 98 | Rights in the Work or (ii) assert any associated claims and causes of 99 | action with respect to the Work, in either case contrary to Affirmer's 100 | express Statement of Purpose. 101 | 102 | 4. Limitations and Disclaimers. 103 | 104 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 105 | surrendered, licensed or otherwise affected by this document. 106 | b. Affirmer offers the Work as-is and makes no representations or 107 | warranties of any kind concerning the Work, express, implied, 108 | statutory or otherwise, including without limitation warranties of 109 | title, merchantability, fitness for a particular purpose, non 110 | infringement, or the absence of latent or other defects, accuracy, or 111 | the present or absence of errors, whether or not discoverable, all to 112 | the greatest extent permissible under applicable law. 113 | c. Affirmer disclaims responsibility for clearing rights of other persons 114 | that may apply to the Work or any use thereof, including without 115 | limitation any person's Copyright and Related Rights in the Work. 116 | Further, Affirmer disclaims responsibility for obtaining any necessary 117 | consents, permissions or other rights required for any use of the 118 | Work. 119 | d. Affirmer understands and acknowledges that Creative Commons is not a 120 | party to this document and has no duty or obligation with respect to 121 | this CC0 or use of the Work. 122 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Arduino Library Manager list 2 | 3 | This repository contains the list of libraries in the 4 | [Arduino Library Manager](https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries#using-the-library-manager) index. 5 | 6 | ## Table of Contents 7 | 8 | 9 | 10 | - [Frequently asked questions](#frequently-asked-questions) 11 | - [Adding a library to Library Manager](#adding-a-library-to-library-manager) 12 | - [Instructions](#instructions) 13 | - [If the problem is with the pull request:](#if-the-problem-is-with-the-pull-request) 14 | - [If the problem is with the library:](#if-the-problem-is-with-the-library) 15 | - [Changing the URL of a library already in Library Manager](#changing-the-url-of-a-library-already-in-library-manager) 16 | - [Removing a library from Library Manager](#removing-a-library-from-library-manager) 17 | - [Report a problem with Library Manager](#report-a-problem-with-library-manager) 18 | - [Security & Malware Reporting](#security--malware-reporting) 19 | 20 | 21 | 22 | ## Frequently asked questions 23 | 24 | For more information about Arduino Library Manager and how the index is maintained, please see [the FAQ](FAQ.md). 25 | 26 | ## Adding a library to Library Manager 27 | 28 | If you would like to make a library available for installation via Library Manager, just submit a 29 | [pull request](https://docs.github.com/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests) 30 | that adds the repository URL to [the list](repositories.txt). You are welcome to add multiple libraries at once. 31 | 32 | See the instructions below for detailed instructions on how to do this via the GitHub web interface. 33 | 34 | ### Instructions 35 | 36 | --- 37 | 38 | ⚠ If you behave irresponsibly in your interactions with this repository, your Library Manager Registry privileges will be revoked. 39 | 40 | Carefully read and follow the instructions in any comments the bot and human maintainers make on your pull requests. If you are having trouble following the instructions, add a comment that provides a detailed description of the problem you are having and a human maintainer will provide assistance. 41 | 42 | Although we have set up automation for the most basic tasks, this repository is maintained by humans. So behave in a manner appropriate for interacting with humans, including clearly communicating what you are hoping to accomplish. 43 | 44 | --- 45 | 46 | 1. You may want to first take a look at 47 | [the requirements for admission into the Arduino Library Manager index](FAQ.md#submission-requirements). Each submission will be checked for 48 | compliance before being accepted. 49 | 1. Click the following link:
50 | https://github.com/arduino/library-registry/fork
51 | The "**Create a new fork**" page will open. 52 | 1. Click the Create fork button in the "**Create a new fork**" page.
53 | A "**Forking arduino/library-registry**" page will open while the fork is in the process of being created. 54 | 1. Wait for the "Forking" process to finish.
55 | The home page of your [fork](https://docs.github.com/get-started/quickstart/fork-a-repo) of the **library-registry** repository will open. 56 | 1. Click on the file `repositories.txt` under the list of files you see in that page.
57 | The "**library-registry/repositories.txt**" page will open. 58 | 1. Click the pencil icon ("Edit this file") at the right side of the toolbar in the "**library-registry/repositories.txt**" page.
59 | The `repositories.txt` file will open in the online text editor. 60 | 1. Add the library repository's URL to the list (it doesn't matter where in the list). This should be the URL of the repository home page. For example: 61 | `https://github.com/arduino-libraries/Servo` 62 | 1. Click the Commit changes... button located near the top right corner of the page.
63 | The "**Commit changes**" dialog will open. 64 | 1. Click the Commit changes button in the "**Commit changes**" dialog.
65 | The "**library-registry/repositories.txt**" page will open. 66 | 1. Click the "**library-registry**" link at the top of the "**library-registry/repositories.txt**" page.
67 | The home page of your fork of the **library-registry** repository will open. 68 | 1. You should see a banner on the page that says: 69 | 70 | > **This branch is 1 commit ahead of arduino:main.** 71 | 72 | Click the "**Contribute**" link near the right side of that banner.
73 | A menu will open. 74 | 75 | 1. Click the Open pull request button in the menu.
76 | The "**Open a pull request**" page will open. 77 | 1. In the **"Open a pull request"** window that opens, click the Create pull request button. 78 | 79 | The library will be automatically checked for compliance as soon as the pull request is submitted. If no problems were 80 | found, the pull request will be immediately merged and the library will be available for installation via Library 81 | Manager within a day's time. 82 | 83 | If any problems are found, a bot will comment on the pull request to tell you what is wrong. The problem may be either 84 | with your pull request or with the library. 85 | 86 | #### If the problem is with the pull request: 87 | 88 | Edit the file in the 89 | [branch](https://docs.github.com/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches) 90 | you submitted the pull request from in your fork of the `arduino/library-registry` repository, then commit. 91 | 92 | Doing this will update the pull request and cause the automated checks to run again. 93 | 94 | #### If the problem is with the library: 95 | 96 | 1. Make the necessary fix in the library repository. 97 | 1. Increment the `version` value in the library's 98 | [library.properties file](https://arduino.github.io/arduino-cli/latest/library-specification/#library-metadata). 99 | 1. Create a 100 | [release](https://docs.github.com/repositories/releasing-projects-on-github/managing-releases-in-a-repository) 101 | or [tag](https://git-scm.com/docs/git-tag). The Library Manager index always uses tagged versions of the libraries, 102 | so even if the development version of the library is compliant, it can't be accepted until the latest release or tag 103 | is compliant. Alternatively, you can redo the existing release/tag if you prefer. 104 | 1. Comment on your pull request here in the `arduino/library-registry` repository, mentioning **@ArduinoBot** in the 105 | comment. Doing this will cause the automated check to run again. 106 | 107 | ## Changing the URL of a library already in Library Manager 108 | 109 | Submit a pull request that changes the URL as desired in [repositories.txt](repositories.txt). This can be done by 110 | following [the instructions above](#instructions). 111 | 112 | Since this type of request must be reviewed by a human maintainer, please write an explanation in the pull request 113 | description, making it clear that the URL is intentionally being changed. 114 | 115 | ## Removing a library from Library Manager 116 | 117 | Submit a pull request that removes the URL from [repositories.txt](repositories.txt). This can be done by following 118 | [the instructions above](#instructions). 119 | 120 | Since this type of request must be reviewed by a human maintainer, please write an explanation in the pull request 121 | description, making it clear that the URL is intentionally being removed. 122 | 123 | ## Report a problem with Library Manager 124 | 125 | First, please take a look at [the FAQ](FAQ.md). If a library release is missing from Library Manager, it is usually 126 | because it was not compliant with all [the requirements](FAQ.md#update-requirements) listed in that document. 127 | 128 | This repository is not an appropriate place to request support or report problems with a library. Check the library's 129 | own documentation for instructions or ask on the [Arduino Forum](https://forum.arduino.cc/). 130 | 131 | If the problem is about something else, please submit an issue report [here](https://github.com/arduino/library-registry/issues/new/choose). 132 | 133 | ## Security & Malware Reporting 134 | 135 | If you think you found a vulnerability, malware or other security-related defect in any Arduino Library projects, please take a look at our security policy and report it to our Security Team 🛡️. 136 | 137 | Thank you! 138 | 139 | E-mail contact: security@arduino.cc 140 | -------------------------------------------------------------------------------- /FAQ.md: -------------------------------------------------------------------------------- 1 | # Arduino Library Manager FAQ 2 | 3 | ## Table of Contents 4 | 5 | 6 | 7 | - [General](#general) 8 | - [What is the Arduino Library Manager?](#what-is-the-arduino-library-manager) 9 | - [How is the Library Manager index generated?](#how-is-the-library-manager-index-generated) 10 | - [Submission](#submission) 11 | - [How can I add a library to Library Manager?](#how-can-i-add-a-library-to-library-manager) 12 | - [What are the requirements for a library to be added to Library Manager?](#what-are-the-requirements-for-a-library-to-be-added-to-library-manager) 13 | - [Who is allowed to add a library to Library Manager?](#who-is-allowed-to-add-a-library-to-library-manager) 14 | - [Updates](#updates) 15 | - [How can I publish a new release once my library is in the list?](#how-can-i-publish-a-new-release-once-my-library-is-in-the-list) 16 | - [What are the requirements for publishing new releases of libraries already in the Library Manager list?](#what-are-the-requirements-for-publishing-new-releases-of-libraries-already-in-the-library-manager-list) 17 | - [Why aren't releases of my library being picked up by Library Manager?](#why-arent-releases-of-my-library-being-picked-up-by-library-manager) 18 | - [Can I check on library releases being added to Library Manager?](#can-i-check-on-library-releases-being-added-to-library-manager) 19 | - [How can I remove a release of my library from Library Manager?](#how-can-i-remove-a-release-of-my-library-from-library-manager) 20 | - [How can I change a library's name?](#how-can-i-change-a-librarys-name) 21 | - [Limitations](#limitations) 22 | - [Is my Git repository OK?](#is-my-git-repository-ok) 23 | - [Are Git submodules supported?](#are-git-submodules-supported) 24 | - [Usage](#usage) 25 | - [Can I add my own URL with my own library index?](#can-i-add-my-own-url-with-my-own-library-index) 26 | - [When I install a library that I know depends on another library, will this other library be installed as well?](#when-i-install-a-library-that-i-know-depends-on-another-library-will-this-other-library-be-installed-as-well) 27 | - [Can I install multiple versions of one library and use the proper one in my sketches?](#can-i-install-multiple-versions-of-one-library-and-use-the-proper-one-in-my-sketches) 28 | - [How can I remove a library I installed via Library Manager?](#how-can-i-remove-a-library-i-installed-via-library-manager) 29 | - [Security & Malware Reporting](#security--malware-reporting) 30 | 31 | 32 | 33 | ## General 34 | 35 | ### What is the Arduino Library Manager? 36 | 37 | Library Manager is a feature of the Arduino development software which makes it easy for users to find, install, and update both official and 3rd party libraries. 38 | 39 | - In the Arduino IDE: **Sketch > Include Library > Manage Libraries...** 40 | - In Arduino CLI: `arduino-cli lib --help` 41 | - In Arduino Web Editor: all Library Manager libraries are pre-installed. 42 | 43 | When a library is [added to the library list](README.md#adding-a-library-to-library-manager), every release of the library will automatically be made available for installation via Library Manager. Users can set their preferences to display an update notification when a new version of any installed library on the list is available and easily update to the new version with just a couple clicks. 44 | 45 | More information: 46 | 47 | - https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-installing-a-library#installing-a-library 48 | - https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries#using-the-library-manager 49 | - https://arduino.github.io/arduino-cli/latest/commands/arduino-cli_lib/ 50 | - https://docs.arduino.cc/arduino-cloud/guides/editor/#library-manager 51 | 52 | ### How is the Library Manager index generated? 53 | 54 | [The Library Manager index](http://downloads.arduino.cc/libraries/library_index.json) contains the data for every release of every one of the thousands of libraries that have been added to the Library Manager list. This index is used by Library Manager to provide installation and updates of the libraries as well as to generate automated documentation pages for the [Arduino Library Reference](https://www.arduino.cc/reference/en/libraries/). 55 | 56 | Every hour, the automated Library Manager indexer system: 57 | 58 | 1. checks every repository in the Library Manager list for new tags, updating [the logs](#can-i-check-on-library-releases-being-added-to-library-manager) accordingly 59 | 1. checks whether those tags meet [the requirements for addition to the index](#update-requirements) 60 | 1. adds entries to the index for compliant tags 61 | 1. pushes the updated index to Arduino's download server 62 | 63 | ## Submission 64 | 65 | 66 | 67 | ### How can I add a library to Library Manager? 68 | 69 | Follow the instructions [here](README.md#adding-a-library-to-library-manager). 70 | 71 | 72 | 73 | ### What are the requirements for a library to be added to Library Manager? 74 | 75 | - [ ] The library must be something of potential value to the Arduino community. 76 | - [ ] The submitter must behave in a responsible manner in their interactions with the Library Manager Registry. 77 | - [ ] The library must be fully compliant with the [Arduino Library Specification](https://arduino.github.io/arduino-cli/latest/library-specification). 78 | - [ ] The library must have [a library.properties file](https://arduino.github.io/arduino-cli/latest/library-specification/#library-metadata), in compliance with the Arduino Library 1.5 format. 79 | - [ ] The library.properties file must be located in the root of the repository. 80 | - [ ] The library must not have the same library.properties `name` value (regardless of case) as another library previously added to the Library Manager list. 81 | - [ ] For 3rd party libraries, the `name` field in library.properties must not start with `Arduino`. 82 | - [ ] The library repository must not contain any `.exe` files. 83 | - [ ] The library repository must not contain a [`.development` file](https://arduino.github.io/arduino-cli/latest/library-specification/#development-flag-file). 84 | - [ ] The library repository must not contain any [symlinks](https://wikipedia.org/wiki/Symbolic_link). 85 | - [ ] The library repository must not contain any files detected as infected by our antivirus scan. 86 | - [ ] The library repository must have a [Git tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging) (or [release](https://docs.github.com/repositories/releasing-projects-on-github/managing-releases-in-a-repository)) and must have been compliant with all the above requirements at the time of that tag. 87 | - [ ] The library repository must be hosted on a major Git-hosting website like GitHub, BitBucket or GitLab (other hosting sites may be considered on request). 88 | 89 | Arduino has created a command line tool to check libraries for compliance with all the Library Manager requirements: 90 | 91 | https://github.com/arduino/arduino-lint 92 | 93 | Arduino Lint is also available as a GitHub Actions action that can be used in the CI systems of Arduino library repositories to ensure continued compliance: 94 | 95 | https://github.com/arduino/arduino-lint-action 96 | 97 | ### Who is allowed to add a library to Library Manager? 98 | 99 | Everyone is welcome to submit libraries for inclusion in Library Manager, regardless of whether you are involved in the library's development. 100 | 101 | Note that libraries will need to be compliant with [all requirements](#update-requirements) in order to be accepted. If not, you will need to work with the library maintainer to achieve compliance. 102 | 103 | ## Updates 104 | 105 | ### How can I publish a new release once my library is in the list? 106 | 107 | 1. Make sure the library is compliant with [all requirements](#update-requirements). 108 | 1. Update the `version` in the library's [`library.properties`](https://arduino.github.io/arduino-cli/latest/library-specification/#library-metadata)). 109 | 1. Tag the library's repository once more and push the new tag (or create a release if the library's Git-hosting site offers a way to do it, for example with [GitHub "releases"](https://docs.github.com/repositories/releasing-projects-on-github/managing-releases-in-a-repository)). 110 | 111 | [Our indexer](#how-is-the-library-manager-index-generated) checks for new releases every hour and will eventually fetch and publish the new release. 112 | 113 | 114 | 115 | ### What are the requirements for publishing new releases of libraries already in the Library Manager list? 116 | 117 | - [ ] The library must be compliant with all the same [requirements that apply to submissions](#submission-requirements). 118 | - [ ] The `name` property in library.properties must not have changed from the value it had when the library was submitted. If you must change the library name, see [this](#how-can-i-change-my-librarys-name). 119 | - [ ] The `version` property in library.properties must not be the same as it was in a tag previously added to the Library Manager index. 120 | 121 | ### Why aren't releases of my library being picked up by Library Manager? 122 | 123 | The Library Manager indexer job will reject any releases which aren't compliant with all [the requirements](#update-requirements). 124 | 125 | You can check [the indexer logs](#can-i-check-on-library-releases-being-added-to-library-manager) for information about what happened. 126 | 127 | ### Can I check on library releases being added to Library Manager? 128 | 129 | There is a dedicated web page for each library that shows the logs from the Library Manager indexer. The URL of the logs page is based on the library's repository URL: 130 | 131 | ``` 132 | http://downloads.arduino.cc/libraries/logs/// 133 | ``` 134 | 135 | For example, the Servo library is hosted at https://github.com/arduino-libraries/Servo, so its logs are at: 136 | 137 | http://downloads.arduino.cc/libraries/logs/github.com/arduino-libraries/Servo/ 138 | 139 | 140 | 141 | ### How can I remove a release of my library from Library Manager? 142 | 143 | If you discover a problem with the library release, simply fix the problem and make a new [release](#how-can-i-publish-a-new-release-once-my-library-is-in-the-list). Library Manager defaults to installing the latest version of the library and offers updates to those with an older version installed, so this is the fastest and most effective method for distributing a fix to the users. 144 | 145 | In the event a library release is later discovered to contain something that absolutely can not be published, we do allow removing releases from Library Manager on request by the following procedure: 146 | 147 | 1. Delete the [tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging) of the problematic release from the library's repository. 148 | 1. Open an issue [here](https://github.com/arduino/library-registry/issues/new?labels=topic%3A+release+removal&template=release-removal.yml&title=Library+release+removal+request), specifying the name of the library and the version number of the release that should be removed. 149 | 150 | 151 | 152 | ### How can I change a library's name? 153 | 154 | For the sake of continuity, libraries in the Library Manager list are locked to the name they had at the time they were added to the list. Changing the library name can be disruptive to its users because this is the unique identifier for the library used by the Arduino development software [command line interfaces](https://arduino.github.io/arduino-cli/latest/commands/arduino-cli_lib/), sketch [metadata](https://arduino.github.io/arduino-cli/latest/sketch-specification/#metadata), library [dependencies](https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format), and installation location. 155 | 156 | If you wish to change the name it will need to be done manually by request: 157 | 158 | 1. Change the `name` value in the [library.properties file](https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format) and update the `version`. 159 | 1. Create a release or tag. 160 | 1. Open an issue [here](https://github.com/arduino/library-registry/issues/new?labels=topic%3A+rename&template=rename.yml&title=Library+name+change+request) specifying the URL of the library's repository. 161 | 162 | ## Limitations 163 | 164 | ### Is my Git repository OK? 165 | 166 | Your repo is OK if it meets all [the requirements listed here](#submission-requirements). 167 | 168 | ### Are Git submodules supported? 169 | 170 | No. The library archive distributed by Library Manager will only contain an empty folder where the submodule should be. 171 | 172 | ## Usage 173 | 174 | ### Can I add my own URL with my own library index? 175 | 176 | No. At the moment, the Arduino development software handles one URL only, and that's written into the code (dev jargon: it's hardcoded), this is a known limitation. 177 | However, if you know your way through the code, you can change that URL with another one. 178 | 179 | ### When I install a library that I know depends on another library, will this other library be installed as well? 180 | 181 | As of Arduino IDE 1.8.10 and Arduino CLI 0.7.0, you can specify the dependencies of a library in the `depends` field of library.properties. Those libraries can be installed automatically when someone installs that library via Library Manager. 182 | 183 | For more information, see the [`library.properties` file format documentation](https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format). 184 | 185 | ### Can I install multiple versions of one library and use the proper one in my sketches? 186 | 187 | Library Manager installs libraries into your sketchbook's `libraries` folder. Since you cannot create two folders with the same name, we can't install two versions of the same library. However, you can switch between library versions by selecting the appropriate one from the version dropdown that pops up on Library Manager when more than one version is available. 188 | 189 | ### How can I remove a library I installed via Library Manager? 190 | 191 | #### Arduino IDE 2.x 192 | 193 | Hover the mouse pointer over the INSTALLED label on the library listing in Library Manager. It will now change to UNINSTALL, which you can click to uninstall that library. 194 | 195 | #### Classic Arduino IDE 196 | 197 | This version of the Arduino IDE does not have an integrated uninstall functionality, so you will need to remove the library manually. Open your sketchbook's `libraries` folder with your operating system's file explorer (Windows: Explorer, Mac: Finder, Linux: Nautilus, kfiles...) and delete the folder containing the library. 198 | 199 | #### Arduino CLI 200 | 201 | Libraries can be uninstalled via [the `arduino-cli lib uninstall` command](https://arduino.github.io/arduino-cli/latest/commands/arduino-cli_lib_uninstall/). 202 | 203 | ## Security & Malware Reporting 204 | 205 | If you think you found a vulnerability, malware or other security-related defect in any Arduino Library projects, please take a look at our security policy and report it to our Security Team 🛡️. 206 | 207 | Thank you! 208 | 209 | E-mail contact: security@arduino.cc 210 | -------------------------------------------------------------------------------- /.github/workflows/manage-prs.yml: -------------------------------------------------------------------------------- 1 | name: Manage PRs 2 | 3 | env: 4 | SUBMISSION_PARSER_VERSION: 2.0.0 # See: https://github.com/arduino/library-manager-submission-parser/releases 5 | MAINTAINERS: | 6 | # GitHub user names to request reviews from in cases where PRs can't be managed automatically. 7 | - per1234 8 | CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_PREFIX: check-submissions-failed- 9 | ERROR_MESSAGE_PREFIX: ":x: **ERROR:** " 10 | 11 | on: 12 | # pull_request_target trigger is used instead of pull_request so the token will have the write permissions needed to 13 | # comment and merge. 14 | # Note that this means the version of the workflow from the PR base ref will be used as opposed to the head ref, as is 15 | # the case with pull_request triggered workflows. 16 | # See: https://docs.github.com/actions/reference/events-that-trigger-workflows#pull_request_target 17 | pull_request_target: 18 | types: 19 | - opened 20 | - ready_for_review 21 | - synchronize 22 | issue_comment: 23 | types: 24 | - created 25 | - edited 26 | 27 | concurrency: 28 | group: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} 29 | cancel-in-progress: >- 30 | ${{ 31 | ( 32 | github.event_name == 'pull_request_target' && 33 | github.event.pull_request.draft == false 34 | ) || 35 | ( 36 | github.event_name == 'issue_comment' && 37 | github.event.issue.pull_request != '' && 38 | github.event.issue.state == 'open' && 39 | contains(github.event.comment.body, 'ArduinoBot') 40 | ) 41 | }} 42 | 43 | jobs: 44 | diff: 45 | if: > 46 | ( 47 | github.event_name == 'pull_request_target' && 48 | github.event.pull_request.draft == false 49 | ) || 50 | ( 51 | github.event_name == 'issue_comment' && 52 | github.event.issue.pull_request != '' && 53 | github.event.issue.state == 'open' && 54 | contains(github.event.comment.body, 'ArduinoBot') 55 | ) 56 | runs-on: ubuntu-latest 57 | outputs: 58 | artifact: ${{ steps.configuration.outputs.artifact }} 59 | path: ${{ steps.configuration.outputs.path }} 60 | filename: ${{ steps.configuration.outputs.filename }} 61 | head: ${{ steps.head.outputs.head }} 62 | 63 | env: 64 | # See: https://docs.github.com/rest/reference/pulls#custom-media-types-for-pull-requests 65 | DIFF_IDENTIFIER: diff 66 | JSON_IDENTIFIER: raw+json 67 | 68 | steps: 69 | - name: Set configuration outputs 70 | id: configuration 71 | run: | 72 | echo "::set-output name=artifact::diff" 73 | echo "::set-output name=path::${{ runner.temp }}" 74 | echo "::set-output name=filename::${{ env.DIFF_IDENTIFIER }}" 75 | 76 | - name: Comment on comment trigger to provide feedback 77 | if: github.event_name == 'issue_comment' 78 | uses: octokit/request-action@v2.x 79 | env: 80 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 81 | with: 82 | # NOTE: "Unexpected input(s) ..." warnings for the arbitrary octokit/request-action inputs are normal and 83 | # expected. 84 | route: POST /repos/{owner}/{repo}/issues/{issue_number}/comments 85 | owner: ${{ github.repository_owner }} 86 | repo: ${{ github.event.repository.name }} 87 | issue_number: ${{ github.event.issue.number }} 88 | body: | 89 | | 90 | Hello! I'm checking your submission again. 91 | 92 | - name: Get PR data 93 | env: 94 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 95 | run: | 96 | # Two API requests are necessary, one for the PR diff and another for the metadata. 97 | # It's necessary to reference both pull_request.number and issue.number because only one of the two are 98 | # defined depending on whether the workflow is triggered by PR or comment event. 99 | parallel \ 100 | ' \ 101 | curl \ 102 | --fail \ 103 | --output "${{ steps.configuration.outputs.path }}/{}" \ 104 | --header "Authorization: token $GITHUB_TOKEN" \ 105 | --header "Accept: application/vnd.github.v3.{}" \ 106 | https://api.github.com/repos/${{ github.repository_owner }}/${{ github.event.repository.name }}/pulls/${{ github.event.pull_request.number }}${{ github.event.issue.number }} 107 | ' \ 108 | ::: \ 109 | ${{ env.DIFF_IDENTIFIER }} \ 110 | ${{ env.JSON_IDENTIFIER }} 111 | 112 | - name: Get head SHA of diff 113 | id: head 114 | run: echo "::set-output name=head::$(jq -c .head.sha "${{ steps.configuration.outputs.path }}/${{ env.JSON_IDENTIFIER }}")" 115 | 116 | - name: Upload diff file to workflow artifact 117 | uses: actions/upload-artifact@v4 118 | with: 119 | path: ${{ steps.configuration.outputs.path }}/${{ steps.configuration.outputs.filename }} 120 | name: ${{ steps.configuration.outputs.artifact }} 121 | 122 | parse: 123 | needs: 124 | - diff 125 | runs-on: ubuntu-latest 126 | 127 | outputs: 128 | conclusion: ${{ steps.parse-request.outputs.conclusion }} 129 | type: ${{ steps.parse-request.outputs.type }} 130 | error: ${{ steps.parse-request.outputs.error }} 131 | arduinoLintLibraryManagerSetting: ${{ steps.parse-request.outputs.arduinoLintLibraryManagerSetting }} 132 | submissions: ${{ steps.parse-request.outputs.submissions }} 133 | index-entry: ${{ steps.parse-request.outputs.index-entry }} 134 | indexer-logs-urls: ${{ steps.parse-request.outputs.indexer-logs-urls }} 135 | 136 | steps: 137 | # Checkout the tip of the default branch (this is the action's default ref input value when workflow is triggered 138 | # by an issue_comment or pull_request_target event). 139 | - name: Checkout local repository 140 | uses: actions/checkout@v4 141 | 142 | - name: Download submission parser 143 | id: download-parser 144 | uses: carlosperate/download-file-action@v2 145 | with: 146 | file-url: https://github.com/arduino/library-registry-submission-parser/releases/download/${{ env.SUBMISSION_PARSER_VERSION }}/parser 147 | location: ${{ runner.temp }} 148 | 149 | - name: Download diff 150 | uses: actions/download-artifact@v4 151 | with: 152 | path: ${{ needs.diff.outputs.path }} 153 | name: ${{ needs.diff.outputs.artifact }} 154 | 155 | - name: Remove no longer needed artifact 156 | uses: geekyeggo/delete-artifact@v5 157 | with: 158 | name: ${{ needs.diff.outputs.artifact }} 159 | 160 | - name: Parse request 161 | id: parse-request 162 | run: | 163 | chmod u+x "${{ steps.download-parser.outputs.file-path }}" 164 | REQUEST="$( \ 165 | "${{ steps.download-parser.outputs.file-path }}" \ 166 | --accesslist=".github/workflows/assets/accesslist.yml" \ 167 | --diffpath="${{ needs.diff.outputs.path }}/${{ needs.diff.outputs.filename }}" \ 168 | --repopath="${{ github.workspace }}" \ 169 | --listname="repositories.txt" \ 170 | --submitter="${{ github.actor }}" \ 171 | )" 172 | # Due to limitations of the GitHub Actions workflow system, dedicated outputs must be created for use in 173 | # certain workflow fields. 174 | echo "::set-output name=conclusion::$(echo "$REQUEST" | jq -r -c '.conclusion')" 175 | echo "::set-output name=type::$(echo "$REQUEST" | jq -r -c '.type')" 176 | echo "::set-output name=error::$(echo "$REQUEST" | jq -r -c '.error')" 177 | echo "::set-output name=arduinoLintLibraryManagerSetting::$(echo "$REQUEST" | jq -r -c '.arduinoLintLibraryManagerSetting')" 178 | echo "::set-output name=submissions::$(echo "$REQUEST" | jq -c '.submissions')" 179 | echo "::set-output name=index-entry::$(echo "$REQUEST" | jq -r -c '.indexEntry')" 180 | echo "::set-output name=indexer-logs-urls::$(echo "$REQUEST" | jq -r -c '.indexerLogsURLs')" 181 | 182 | label: 183 | needs: 184 | - parse 185 | runs-on: ubuntu-latest 186 | 187 | steps: 188 | - name: Label PR 189 | uses: octokit/request-action@v2.x 190 | env: 191 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 192 | with: 193 | route: PUT /repos/{owner}/{repo}/issues/{issue_number}/labels 194 | owner: ${{ github.repository_owner }} 195 | repo: ${{ github.event.repository.name }} 196 | issue_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} 197 | labels: | 198 | - "topic: ${{ needs.parse.outputs.type }}" 199 | 200 | # Handle problem found by the parser that can potentially be resolved by requester. 201 | parse-fail: 202 | needs: 203 | - parse 204 | if: > 205 | needs.parse.outputs.conclusion != 'declined' && 206 | needs.parse.outputs.error != '' 207 | 208 | runs-on: ubuntu-latest 209 | steps: 210 | - name: Comment on error detected while parsing PR 211 | uses: octokit/request-action@v2.x 212 | env: 213 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 214 | with: 215 | route: POST /repos/{owner}/{repo}/issues/{issue_number}/comments 216 | owner: ${{ github.repository_owner }} 217 | repo: ${{ github.event.repository.name }} 218 | issue_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} 219 | body: | 220 | | 221 | Hi @${{ github.actor }} 222 | A problem was found with your pull request: 223 | 224 | ${{ env.ERROR_MESSAGE_PREFIX }}${{ needs.parse.outputs.error }} 225 | 226 | Please resolve this error. The checks will automatically run again once that is done. 227 | 228 | More information: 229 | https://github.com/${{ github.repository }}/blob/main/README.md#if-the-problem-is-with-the-pull-request 230 | 231 | # Requester's registry privileges have been revoked. 232 | decline-request: 233 | needs: 234 | - parse 235 | if: > 236 | needs.parse.outputs.conclusion == 'declined' && 237 | needs.parse.outputs.error != '' 238 | runs-on: ubuntu-latest 239 | steps: 240 | - name: Comment reason for declining request 241 | uses: octokit/request-action@v2.x 242 | if: needs.parse.outputs.error != '' 243 | env: 244 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 245 | with: 246 | route: POST /repos/{owner}/{repo}/issues/{issue_number}/comments 247 | owner: ${{ github.repository_owner }} 248 | repo: ${{ github.event.repository.name }} 249 | issue_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} 250 | body: | 251 | | 252 | Hi @${{ github.actor }} 253 | Your request has been declined: 254 | 255 | ${{ env.ERROR_MESSAGE_PREFIX }}${{ needs.parse.outputs.error }} 256 | 257 | - name: Close PR 258 | uses: octokit/request-action@v2.x 259 | env: 260 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 261 | with: 262 | route: PATCH /repos/{owner}/{repo}/pulls/{pull_number} 263 | owner: ${{ github.repository_owner }} 264 | repo: ${{ github.event.repository.name }} 265 | pull_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} 266 | state: closed 267 | 268 | - name: Add conclusion label to PR 269 | uses: octokit/request-action@v2.x 270 | env: 271 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 272 | with: 273 | # See: https://docs.github.com/rest/issues/labels#add-labels-to-an-issue 274 | route: POST /repos/{owner}/{repo}/issues/{issue_number}/labels 275 | owner: ${{ github.repository_owner }} 276 | repo: ${{ github.event.repository.name }} 277 | issue_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} 278 | labels: | 279 | - "conclusion: ${{ needs.parse.outputs.conclusion }}" 280 | 281 | check-submissions: 282 | name: Check ${{ matrix.submission.submissionURL }} 283 | needs: 284 | - parse 285 | if: > 286 | needs.parse.outputs.type == 'submission' || 287 | needs.parse.outputs.type == 'modification' 288 | 289 | runs-on: ubuntu-latest 290 | strategy: 291 | fail-fast: false 292 | 293 | # A matrix job will run for each of the submission URLs 294 | matrix: 295 | submission: ${{ fromJson(needs.parse.outputs.submissions) }} 296 | 297 | steps: 298 | - name: Set environment variables 299 | run: | 300 | echo "JSON_REPORT_PATH=${{ runner.temp }}/report.json" >> "$GITHUB_ENV" 301 | echo "TEXT_REPORT_PATH=${{ runner.temp }}/report.txt" >> "$GITHUB_ENV" 302 | echo "ARDUINO_LINT_INSTALLATION_PATH=${{ runner.temp }}/arduino-lint" >> "$GITHUB_ENV" 303 | echo "PASS=true" >> "$GITHUB_ENV" # This variable stores the checks result 304 | echo "FAIL_FLAG_PATH=${{ runner.temp }}/.check-submissions-failed" >> "$GITHUB_ENV" 305 | 306 | # Submission PRs can be handled without maintainer involvement 307 | - name: Remove prior review requests 308 | uses: octokit/request-action@v2.x 309 | env: 310 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 311 | with: 312 | route: DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers 313 | owner: ${{ github.repository_owner }} 314 | repo: ${{ github.event.repository.name }} 315 | pull_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} 316 | reviewers: ${{ env.MAINTAINERS }} 317 | 318 | - name: Comment on error detected while parsing submission 319 | if: matrix.submission.error != '' 320 | uses: octokit/request-action@v2.x 321 | env: 322 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 323 | with: 324 | route: POST /repos/{owner}/{repo}/issues/{issue_number}/comments 325 | owner: ${{ github.repository_owner }} 326 | repo: ${{ github.event.repository.name }} 327 | issue_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} 328 | body: | 329 | | 330 | A problem was found with your submission ${{ matrix.submission.submissionURL }} 331 | 332 | ${{ env.ERROR_MESSAGE_PREFIX }}${{ matrix.submission.error }} 333 | 334 | - name: Set checks result to fail if error detected by submission parser 335 | if: matrix.submission.error != '' 336 | run: echo "PASS=false" >> "$GITHUB_ENV" 337 | 338 | # Parser checks are relevant in the case where request is declined due to registry access having been revoked for 339 | # the library repository owners. However, the rest of the checks are irrelevant and may result in confusing 340 | # comments from the bot, so should be skipped. 341 | - name: Skip the rest of the checks if request is declined 342 | if: > 343 | needs.parse.outputs.conclusion == 'declined' && 344 | env.PASS == 'true' 345 | run: echo "PASS=false" >> "$GITHUB_ENV" 346 | 347 | - name: Install Arduino Lint 348 | if: env.PASS == 'true' 349 | run: | 350 | mkdir --parents "${{ env.ARDUINO_LINT_INSTALLATION_PATH }}" 351 | curl \ 352 | -fsSL \ 353 | https://raw.githubusercontent.com/arduino/arduino-lint/main/etc/install.sh \ 354 | | \ 355 | BINDIR="${{ env.ARDUINO_LINT_INSTALLATION_PATH }}" \ 356 | sh 357 | 358 | # actions/checkout can't be used because it only supports GitHub repos, while libraries may use other Git hosts 359 | - name: Clone submission 360 | if: env.PASS == 'true' 361 | run: | 362 | git clone \ 363 | --branch ${{ matrix.submission.tag }} \ 364 | --depth 1 ${{ matrix.submission.normalizedURL }} \ 365 | "${{ matrix.submission.repositoryName }}" 366 | 367 | - name: Lint submission 368 | id: arduino-lint 369 | if: env.PASS == 'true' 370 | continue-on-error: true # Error on linter rule violations is expected 371 | run: | 372 | export ARDUINO_LINT_OFFICIAL="${{ matrix.submission.official }}" 373 | 374 | "${{ env.ARDUINO_LINT_INSTALLATION_PATH }}/arduino-lint" \ 375 | --compliance=permissive \ 376 | --format=text \ 377 | --library-manager=${{ needs.parse.outputs.arduinoLintLibraryManagerSetting }} \ 378 | --project-type=library \ 379 | --recursive=false \ 380 | --report-file="${{ env.JSON_REPORT_PATH }}" \ 381 | "${{ matrix.submission.repositoryName }}" > \ 382 | "${{ env.TEXT_REPORT_PATH }}" 383 | 384 | - name: Read Arduino Lint reports 385 | id: read-lint-report 386 | if: env.PASS == 'true' 387 | run: | 388 | echo "::set-output name=json-report::$(jq -c . "${{ env.JSON_REPORT_PATH }}")" 389 | 390 | # In order to use the text format report as a step output, it's necessary to do some character replacements. 391 | TEXT_REPORT=$(cat "${{ env.TEXT_REPORT_PATH }}") 392 | TEXT_REPORT="${TEXT_REPORT//'%'/'%25'}" 393 | TEXT_REPORT="${TEXT_REPORT//$'\n'/'%0A'}" 394 | TEXT_REPORT="${TEXT_REPORT//$'\r'/'%0D'}" 395 | echo "::set-output name=text-report::$TEXT_REPORT" 396 | 397 | - name: Comment on Arduino Lint warning 398 | if: > 399 | env.PASS == 'true' 400 | && fromJson(steps.read-lint-report.outputs.json-report).summary.warningCount > 0 401 | && fromJson(steps.read-lint-report.outputs.json-report).summary.errorCount == 0 402 | uses: octokit/request-action@v2.x 403 | env: 404 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 405 | with: 406 | route: POST /repos/{owner}/{repo}/issues/{issue_number}/comments 407 | owner: ${{ github.repository_owner }} 408 | repo: ${{ github.event.repository.name }} 409 | issue_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} 410 | body: | 411 | | 412 | [Arduino Lint](https://github.com/arduino/arduino-lint) has suggestions for possible improvements to ${{ matrix.submission.submissionURL }}: 413 | 414 | ``` 415 | ${{ steps.read-lint-report.outputs.text-report }} 416 | ``` 417 | 418 | - name: Comment on Arduino Lint error 419 | if: > 420 | env.PASS == 'true' 421 | && fromJson(steps.read-lint-report.outputs.json-report).summary.errorCount > 0 422 | uses: octokit/request-action@v2.x 423 | env: 424 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 425 | with: 426 | route: POST /repos/{owner}/{repo}/issues/{issue_number}/comments 427 | owner: ${{ github.repository_owner }} 428 | repo: ${{ github.event.repository.name }} 429 | issue_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} 430 | body: | 431 | | 432 | ${{ env.ERROR_MESSAGE_PREFIX }}[Arduino Lint](https://github.com/arduino/arduino-lint) found errors with ${{ matrix.submission.submissionURL }}: 433 | 434 | ``` 435 | ${{ steps.read-lint-report.outputs.text-report }} 436 | ``` 437 | 438 | - name: Set checks result to fail if error detected by Arduino Lint 439 | if: > 440 | env.PASS == 'true' 441 | && steps.arduino-lint.outcome == 'failure' 442 | run: echo "PASS=false" >> "$GITHUB_ENV" 443 | 444 | - name: Create failure flag file 445 | if: env.PASS == 'false' 446 | run: touch ${{ env.FAIL_FLAG_PATH }} # Arbitrary file to provide content for the flag artifact 447 | 448 | # Each workflow artifact must have a unique name. The job matrix doesn't provide a guaranteed unique string to use 449 | # for a name so it is necessary to generate one. 450 | - name: Generate unique artifact suffix 451 | if: env.PASS == 'false' 452 | run: | 453 | echo "CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_SUFFIX=$(cat /proc/sys/kernel/random/uuid)" >> "$GITHUB_ENV" 454 | 455 | # The value of a job matrix output is set by whichever job happened to run last, not of use for this application. 456 | # So it's necessary to use an alternative means of indicating that at least one submission failed the checks. 457 | - name: Upload failure flag artifact 458 | if: env.PASS == 'false' 459 | uses: actions/upload-artifact@v4 460 | with: 461 | if-no-files-found: error 462 | include-hidden-files: true 463 | path: ${{ env.FAIL_FLAG_PATH }} 464 | name: ${{ env.CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_PREFIX }}${{ env.CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_SUFFIX }} 465 | 466 | check-submissions-result: 467 | needs: check-submissions 468 | runs-on: ubuntu-latest 469 | 470 | outputs: 471 | pass: ${{ steps.failure-flag-exists.outcome == 'failure' }} 472 | 473 | env: 474 | CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_PATH: ${{ github.workspace }}/artifacts 475 | 476 | steps: 477 | - name: Download submission check failure flag artifacts 478 | uses: actions/download-artifact@v4 479 | with: 480 | path: ${{ env.CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_PATH }} 481 | pattern: ${{ env.CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_PREFIX }}* 482 | 483 | - name: Check for existence of submission check failure flag artifact 484 | id: failure-flag-exists 485 | continue-on-error: true 486 | # actions/download-artifact does not create a folder per its `path` input if no artifacts match `pattern`. 487 | run: | 488 | test -d "${{ env.CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_PATH }}" 489 | 490 | # Handle problem found by the submission checks that can potentially be resolved by requester. 491 | check-submissions-fail: 492 | needs: 493 | - parse 494 | - check-submissions-result 495 | if: > 496 | needs.parse.outputs.conclusion != 'declined' && 497 | needs.check-submissions-result.outputs.pass == 'false' 498 | runs-on: ubuntu-latest 499 | steps: 500 | - name: Comment instructions to fix errors detected during submission checks 501 | uses: octokit/request-action@v2.x 502 | env: 503 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 504 | with: 505 | route: POST /repos/{owner}/{repo}/issues/{issue_number}/comments 506 | owner: ${{ github.repository_owner }} 507 | repo: ${{ github.event.repository.name }} 508 | issue_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} 509 | body: | 510 | | 511 | Thanks for your interest in contributing to the Arduino Library Manager index @${{ github.actor }} 512 | Please resolve the error(s) mentioned in the previous comment. 513 | 514 | After resolving the issue, trigger this check again by doing one of the following: 515 | 516 | - **Commit the required change to the branch you submitted this pull request from.** 517 | - **Comment here, mentioning `@ArduinoBot` in the comment.** 518 | 519 | :exclamation: **NOTE**: It is not necessary to open a new pull request. :exclamation: 520 | 521 | More information: 522 | https://github.com/${{ github.repository }}/blob/main/README.md#if-the-problem-is-with-the-pull-request 523 | 524 | decline-submissions: 525 | needs: 526 | - parse 527 | - check-submissions 528 | if: needs.parse.outputs.conclusion == 'declined' 529 | runs-on: ubuntu-latest 530 | steps: 531 | - name: Close PR 532 | uses: octokit/request-action@v2.x 533 | env: 534 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 535 | with: 536 | route: PATCH /repos/{owner}/{repo}/pulls/{pull_number} 537 | owner: ${{ github.repository_owner }} 538 | repo: ${{ github.event.repository.name }} 539 | pull_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} 540 | state: closed 541 | 542 | - name: Add conclusion label to PR 543 | uses: octokit/request-action@v2.x 544 | env: 545 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 546 | with: 547 | # See: https://docs.github.com/rest/issues/labels#add-labels-to-an-issue 548 | route: POST /repos/{owner}/{repo}/issues/{issue_number}/labels 549 | owner: ${{ github.repository_owner }} 550 | repo: ${{ github.event.repository.name }} 551 | issue_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} 552 | labels: | 553 | - "conclusion: ${{ needs.parse.outputs.conclusion }}" 554 | 555 | merge: 556 | needs: 557 | - diff 558 | - parse 559 | - check-submissions-result 560 | # Only merge submissions that passed all checks 561 | if: > 562 | needs.parse.outputs.type == 'submission' 563 | && needs.check-submissions-result.outputs.pass == 'true' 564 | runs-on: ubuntu-latest 565 | outputs: 566 | pass: ${{ steps.merge.outcome == 'success' }} 567 | status: ${{ steps.merge.outputs.status }} 568 | 569 | steps: 570 | - name: Approve pull request 571 | uses: octokit/request-action@v2.x 572 | env: 573 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 574 | with: 575 | route: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews 576 | owner: ${{ github.repository_owner }} 577 | repo: ${{ github.event.repository.name }} 578 | pull_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} 579 | event: APPROVE 580 | 581 | - name: Merge pull request 582 | id: merge 583 | continue-on-error: true # Error in some situations (e.g., merge conflict) is expected 584 | uses: octokit/request-action@v2.x 585 | env: 586 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 587 | with: 588 | route: PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge 589 | owner: ${{ github.repository_owner }} 590 | repo: ${{ github.event.repository.name }} 591 | pull_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} 592 | sha: ${{ needs.diff.outputs.head }} 593 | merge_method: squash 594 | 595 | - name: Checkout index source branch 596 | if: steps.merge.outcome == 'success' 597 | uses: actions/checkout@v4 598 | with: 599 | ref: production 600 | 601 | - name: Add index source file entry for submissions 602 | if: steps.merge.outcome == 'success' 603 | run: | 604 | INDEX_SOURCE_FILE_PATH="${{ github.workspace }}/registry.txt" 605 | git config --global user.email "bot@arduino.cc" 606 | git config --global user.name "ArduinoBot" 607 | echo "${{ needs.parse.outputs.index-entry }}" >> "$INDEX_SOURCE_FILE_PATH" 608 | git add --update "$INDEX_SOURCE_FILE_PATH" 609 | echo \ 610 | -e \ 611 | "Add submission # ${{ github.event.pull_request.number }}${{ github.event.issue.number }}\n\n${{ github.event.repository.html_url }}/pull/${{ github.event.pull_request.number }}${{ github.event.issue.number }}" \ 612 | | \ 613 | git commit \ 614 | --file - 615 | git push 616 | 617 | - name: Comment that submission was accepted 618 | if: steps.merge.outcome == 'success' 619 | uses: octokit/request-action@v2.x 620 | env: 621 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 622 | with: 623 | route: POST /repos/{owner}/{repo}/issues/{issue_number}/comments 624 | owner: ${{ github.repository_owner }} 625 | repo: ${{ github.event.repository.name }} 626 | issue_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} 627 | body: | 628 | | 629 | Your submission has now been accepted! Thanks for your contribution to the Arduino Library Manager index. 630 | 631 | The library(s) will be available for installation via Library Manager within a day's time. 632 | 633 | You can check the logs from the Library Manager indexer for your library(s) here: 634 | ${{ needs.parse.outputs.indexer-logs-urls }} 635 | 636 | merge-fail: 637 | needs: 638 | - merge 639 | # Only run if the PR could not be merged 640 | if: needs.merge.outputs.pass == 'false' 641 | runs-on: ubuntu-latest 642 | steps: 643 | - name: Comment on merge fail due to out of sync PR head branch causing downgraded token 644 | if: needs.merge.outputs.status == '403' 645 | uses: octokit/request-action@v2.x 646 | env: 647 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 648 | with: 649 | route: POST /repos/{owner}/{repo}/issues/{issue_number}/comments 650 | owner: ${{ github.repository_owner }} 651 | repo: ${{ github.event.repository.name }} 652 | issue_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} 653 | body: | 654 | | 655 | ${{ env.ERROR_MESSAGE_PREFIX }}Your submission meets all requirements. However, the pull request could not be merged. 656 | 657 | Please follow this guide to sync your fork: 658 | https://docs.github.com/github/collaborating-with-pull-requests/working-with-forks/syncing-a-fork 659 | 660 | Once that is done, it will be merged automatically. 661 | 662 | - name: Comment on merge conflict 663 | if: needs.merge.outputs.status == '405' 664 | uses: octokit/request-action@v2.x 665 | env: 666 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 667 | with: 668 | route: POST /repos/{owner}/{repo}/issues/{issue_number}/comments 669 | owner: ${{ github.repository_owner }} 670 | repo: ${{ github.event.repository.name }} 671 | issue_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} 672 | body: | 673 | | 674 | ${{ env.ERROR_MESSAGE_PREFIX }}Your submission meets all requirements. However, the pull request could not be merged. 675 | 676 | Please follow this guide to resolve a merge conflict: 677 | https://docs.github.com/github/collaborating-with-issues-and-pull-requests/resolving-a-merge-conflict-on-github 678 | 679 | Once that is done, it will be merged automatically. 680 | 681 | - name: Comment on diff head/PR head mismatch 682 | if: needs.merge.outputs.status == '409' 683 | uses: octokit/request-action@v2.x 684 | env: 685 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 686 | with: 687 | route: POST /repos/{owner}/{repo}/issues/{issue_number}/comments 688 | owner: ${{ github.repository_owner }} 689 | repo: ${{ github.event.repository.name }} 690 | issue_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} 691 | body: | 692 | | 693 | It looks like there may have been an update to the pull request. If so, I'll check it again now. 694 | 695 | - name: Fail on unidentified merge failure 696 | if: > 697 | needs.merge.outputs.status != '403' && 698 | needs.merge.outputs.status != '405' && 699 | needs.merge.outputs.status != '409' 700 | run: exit 1 # Trigger the `unexpected-fail` job 701 | 702 | not-submission: 703 | needs: 704 | - parse 705 | # These request types can't be automatically approved. 706 | if: > 707 | needs.parse.outputs.conclusion != 'declined' && 708 | needs.parse.outputs.type != 'submission' && 709 | needs.parse.outputs.type != 'invalid' 710 | runs-on: ubuntu-latest 711 | steps: 712 | - name: Comment on required review 713 | uses: octokit/request-action@v2.x 714 | env: 715 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 716 | with: 717 | route: POST /repos/{owner}/{repo}/issues/{issue_number}/comments 718 | owner: ${{ github.repository_owner }} 719 | repo: ${{ github.event.repository.name }} 720 | issue_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} 721 | body: | 722 | | 723 | Hi @${{ github.actor }}. 724 | Your pull request has been detected as something other than a Library Manager submission. 725 | A maintainer will need to review it before it can be merged. 726 | 727 | If you intended to submit a library, please check the instructions and update your pull request if necessary: 728 | https://github.com/${{ github.repository }}/blob/main/README.md#instructions 729 | 730 | unexpected-fail: 731 | needs: 732 | # Run after all other jobs 733 | - parse-fail 734 | - decline-request 735 | - merge-fail 736 | - check-submissions-fail 737 | - decline-submissions 738 | - label 739 | - not-submission 740 | # Run if any job failed. The workflow is configured so that jobs only fail when there is an unexpected error. 741 | if: failure() 742 | runs-on: ubuntu-latest 743 | 744 | steps: 745 | - name: Label PR to indicate need for maintenance 746 | uses: octokit/request-action@v2.x 747 | env: 748 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 749 | with: 750 | route: PUT /repos/{owner}/{repo}/issues/{issue_number}/labels 751 | owner: ${{ github.repository_owner }} 752 | repo: ${{ github.event.repository.name }} 753 | issue_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} 754 | labels: | 755 | - "status: maintenance required" 756 | 757 | - name: Comment on unexpected failure 758 | uses: octokit/request-action@v2.x 759 | env: 760 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 761 | with: 762 | route: POST /repos/{owner}/{repo}/issues/{issue_number}/comments 763 | owner: ${{ github.repository_owner }} 764 | repo: ${{ github.event.repository.name }} 765 | issue_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} 766 | body: | 767 | | 768 | Hi @${{ github.actor }}. 769 | There was an unexpected failure during automated processing of your pull request. 770 | This error is unrelated to the content of your pull request. 771 | 772 | A maintainer has been notified and will investigate as soon as possible. 773 | 774 | - name: Slack notification of unexpected failure 775 | uses: rtCamp/action-slack-notify@v2 776 | env: 777 | SLACK_WEBHOOK: ${{ secrets.TEAM_TOOLING_CHANNEL_SLACK_WEBHOOK }} 778 | SLACK_MESSAGE: | 779 | :warning::warning::warning::warning: 780 | WARNING: ${{ github.repository }} ${{ github.workflow }} workflow run had an unexpected failure!!! 781 | :warning::warning::warning::warning: 782 | SLACK_COLOR: danger 783 | MSG_MINIMAL: true 784 | 785 | request-review: 786 | needs: 787 | - parse-fail 788 | - merge-fail 789 | - not-submission 790 | - unexpected-fail 791 | if: > 792 | always() && 793 | ( 794 | needs.parse-fail.result != 'skipped' || 795 | needs.merge-fail.result != 'skipped' || 796 | needs.not-submission.result != 'skipped' || 797 | needs.unexpected-fail.result != 'skipped' 798 | ) 799 | runs-on: ubuntu-latest 800 | steps: 801 | - name: Request pull request review from maintainer 802 | if: contains(toJSON(env.MAINTAINERS), github.actor) != true # Don't attempt to request review from PR author. 803 | uses: octokit/request-action@v2.x 804 | env: 805 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 806 | with: 807 | route: POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers 808 | owner: ${{ github.repository_owner }} 809 | repo: ${{ github.event.repository.name }} 810 | pull_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} 811 | reviewers: ${{ env.MAINTAINERS }} 812 | --------------------------------------------------------------------------------