{"id":17960337,"url":"https://github.com/kewisch/action-web-ext","last_synced_at":"2025-04-06T16:14:24.782Z","repository":{"id":40635865,"uuid":"211726919","full_name":"kewisch/action-web-ext","owner":"kewisch","description":"A GitHub Action to run web-ext commands","archived":false,"fork":false,"pushed_at":"2025-02-18T23:37:37.000Z","size":53616,"stargazers_count":51,"open_issues_count":4,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-30T15:09:04.549Z","etag":null,"topics":["github-actions","github-actions-javascript","mozilla","web-ext"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kewisch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-29T21:12:55.000Z","updated_at":"2025-03-23T18:47:23.000Z","dependencies_parsed_at":"2024-06-18T18:35:16.776Z","dependency_job_id":"59add0ed-d58d-4115-b2dd-57cef32ec07b","html_url":"https://github.com/kewisch/action-web-ext","commit_stats":{"total_commits":61,"total_committers":7,"mean_commits":8.714285714285714,"dds":"0.39344262295081966","last_synced_commit":"fe10addf5d5e5ba6b78ffde720dd488a27d10e8c"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kewisch%2Faction-web-ext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kewisch%2Faction-web-ext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kewisch%2Faction-web-ext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kewisch%2Faction-web-ext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kewisch","download_url":"https://codeload.github.com/kewisch/action-web-ext/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247509237,"owners_count":20950232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions","github-actions-javascript","mozilla","web-ext"],"created_at":"2024-10-29T11:06:09.398Z","updated_at":"2025-04-06T16:14:19.773Z","avatar_url":"https://github.com/kewisch.png","language":"JavaScript","readme":"web-ext GitHub Action\n=====================\n\n[![Build](https://github.com/kewisch/action-web-ext/actions/workflows/ci.yml/badge.svg)](https://github.com/kewisch/action-web-ext/actions/workflows/ci.yml)\n\nThis action allows you to run a few [mozilla/web-ext](https://github.com/mozilla/web-ext) commands\nuseful during add-on development. It supports `lint`, `build` and `sign`.\n\nGenerally you can use these inputs:\n\n* `cmd`: The command to run (lint, build, sign)\n* `source`: The directory the add-on is in. For `sign`, this should be the xpi file instead\n* `artifacts`: The output directory, defaults to web-ext-artifacts\n* `verbose`: Output more debugging if set to true\n* `channel`: The channel to use, `listed` or `unlisted`\n* `ignoreFiles`: A json string containing an array of files to be ignored. Web-ext by default already ignores the most frequently ignored files.\n\nThere are a few more specific to each command.\n\nlint\n----\n\nLinting supports annotations, this is great for pull requests. A token is not required for this action, though if\n`GITHUB_TOKEN` is in the environment, it will be used to create a check run that gives you more detailed information.\n\n```yaml\nname: \"Lint\"\non:\n  push:\n    branches:\n      - main\n  pull_request:\n\njobs:\n  lint:\n    name: \"Lint\"\n    runs-on: ubuntu-latest\n    steps:\n      - name: \"Checkout\"\n        uses: actions/checkout@v4\n\n      - name: \"web-ext lint\"\n        uses: kewisch/action-web-ext@v1\n        with:\n          cmd: lint\n          source: src\n          channel: listed\n```\n\nbuild\n-----\n\nA simple web-ext build.\nYou can use the `target` output for subsequent steps.\n\nYou can use the following extra options:\n* `filename`: Template string for the packed extension's filename, available for download through the job's artifacts. The placeholders in braces (`{...}`) are replaced by the corresponding entries in the extension's `manifest.json`. E.g. `\"{name}-{version}.xpi\"`.\n\n```yaml\nname: \"Build\"\non:\n  push:\n    branches:\n      - main\n  pull_request:\n\njobs:\n  build:\n    name: \"Build\"\n    runs-on: ubuntu-latest\n    steps:\n      - name: \"Checkout\"\n        uses: actions/checkout@v4\n\n      - name: \"web-ext build\"\n        id: web-ext-build\n        uses: kewisch/action-web-ext@v1\n        with:\n          cmd: build\n          source: src\n          filename: \"{name}-{version}.xpi\"\n          ignoreFiles: '[ \"package.json\",\"package-lock.json\",\"yarn.lock\" ]'\n\n      - name: \"Upload Artifact\"\n        uses: actions/upload-artifact@v4\n        with:\n          name: target.xpi\n          path: ${{ steps.web-ext-build.outputs.target }}\n```\n\nsign\n----\n\nSend the add-on for signature to AMO. To reduce the load on AMO servers, please don't use this for\non-commit or nightly builds. If you want to test your add-on you can do so in `about:debugging`.\nUsing this for betas or releases is great though. Please note that listed add-ons will not be signed\nimmediately, this is indicated during the build process but is not counted as a failure.\n\nYou can use the following extra options:\n* `sourceCode`: Submit a zip with source code to adhere to the source code submission policy.\n* `metaDataFile`: A JSON file with additional metadata for the version release. See example below\n   for details.\n* `approvalNotes`: A shortcut to set .version.approval_notes in the submitted metadata.\n* `releaseNotes`: A shortcut to set .version.release_notes in the submitted metadata.\n* `license`: The license for the version. See example below for details.\n* `licenseFile`: If using a custom license, the license file to submit.\n* `apiKey`: The API key used for signing.\n* `apiSecret`: The API secret used for signing.\n* `apiUrlPrefix`: The URL of the signing API, defaults to AMO production.\n* `timeout`: The number of milliseconds to wait before giving up on a response from Mozilla's web\n   service. Defaults to 900000 ms (15 minutes).\n\nChanging `apiUrlPrefix` to https://addons.thunderbird.net/api/v4 will allow you to submit to\n[addons.thunderbird.net](https://addons.thunderbird.net), or you can make use of the\n[staging/dev instances](https://mozilla.github.io/addons-server/topics/api/index.html#external-api).\n\nPlease see the example below on how to use the sign command.\n\nComplete example\n----------------\n\nThis is a complete example of a publish script. It is triggered when you create and publish a\nrelease on GitHub. You can of course also turn things around and trigger on tag creation, and\nsubsequently create the release if the upload succeeds.\n\n```yaml\nname: \"Publish\"\non:\n  release:\n    types: [published]\n\njobs:\n  sign:\n    name: \"Release\"\n    runs-on: ubuntu-latest\n    steps:\n      - name: \"Checkout\"\n        uses: actions/checkout@v4\n\n      - name: \"web-ext lint\"\n        uses: kewisch/action-web-ext@v1\n        with:\n          cmd: lint\n          source: src\n          channel: listed\n\n      - name: \"web-ext build\"\n        id: web-ext-build\n        uses: kewisch/action-web-ext@v1\n        with:\n          cmd: build\n          source: src\n\n      - name: \"Collect sources\"\n        run: git archive --format=zip --output=sources.zip ${{ github.ref }}\n\n      - name: \"Collect metadata\"\n        id: metadata\n        run: echo \"json=$(jq -c . \u003c amo_metadata.json)\" \u003e\u003e $GITHUB_OUTPUT\n\n      - name: \"web-ext sign AMO\"\n        id: web-ext-sign\n        uses: kewisch/action-web-ext@v1\n        with:\n          cmd: sign\n\n          # Source must be the zip/xpi file of the add-on. If your add-on is required to submit\n          # source as per https://extensionworkshop.com/documentation/publish/source-code-submission/\n          # policy, you can use sourceCode with a zip file of the original sources. Submitting\n          # source code is not always required, don't do so if you don't need to.\n          source: ${{ steps.web-ext-build.outputs.target }}\n          sourceCode: sources.zip\n          channel: unlisted\n\n          # Various metadata you can set through the API. See the documentation for the\n          # --amo-metadata parameter to web-ext sign at\n          # https://extensionworkshop.com/documentation/develop/web-ext-command-reference/#web-ext-sign\n          # for more information. You can leave out metaDataFile if all you want to set is approval\n          # notes, release notes, or a license.\n          metaDataFile: amo_metadata.json\n          approvalNotes: \"Please find more information at https://github.com/kewisch/action-web-ext\"\n          releaseNotes: ${{ github.event.release.body }}\n\n          # You can set one of the known licenses from\n          # https://mozilla.github.io/addons-server/topics/api/licenses.html#license-list\n          # by just passing the license property. If you have a custsom license, read it from a\n          # file as follows.\n          license: Apache-2.0       # You only need to specify a license file if you are using a\n          licenseFile: LICENSE.md   # custom license. Please see action.yml for details.\n\n          # Specify API secrets. No need to specify apiUrlPrefix, it defaults to AMO production\n          apiKey: ${{ secrets.AMO_SIGN_KEY }}\n          apiSecret: ${{ secrets.AMO_SIGN_SECRET }}\n          timeout: 900000\n\n      - name: \"web-ext sign ATN\"\n        id: web-ext-sign\n        uses: kewisch/action-web-ext@v1\n        with:\n          # This is how to sign for Thunderbird. Note that Thunderbird uses API v4, where many\n          # metadata fields are not supported.\n          cmd: sign\n          source: ${{ steps.web-ext-build.outputs.target }}\n          channel: listed\n          apiUrlPrefix: \"https://addons.thunderbird.net/api/v4\"\n          apiKey: ${{ secrets.ATN_SIGN_KEY }}\n          apiSecret: ${{ secrets.ATN_SIGN_SECRET }}\n\n      - name: \"Attach release assets to release\"\n        env:\n          GH_TOKEN: ${{ github.token }}\n        run: |\n          gh release upload ${{ github.event.release.tag_name }} \\\n            ${{ steps.web-ext-sign.outputs.target }}\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkewisch%2Faction-web-ext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkewisch%2Faction-web-ext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkewisch%2Faction-web-ext/lists"}