A GitHub Action that creates a new CodeSpell submission by collecting source files from a repository and sending them to the CodeSpell REST API.
The action:
- Globs files under the configured
source-path(e.g.src/**/*.*). - Reads and base64-encodes each file (skips files larger than 65535 bytes).
- Obtains an access token from the configured
auth-url/auth-realmusingusernameandpassword. - Sends the collected files and metadata to the CodeSpell API at
${api-url}/submissionsto create a new submission.
api-url: Base URL for the CodeSpell API (e.g.https://api.codespell.example).auth-url: Base URL for the authentication server used to obtain a token.auth-realm: Authentication realm (used when building the token endpoint path).username: Username for authentication (recommended: use a repository secret).password: Password for authentication (recommended: use a repository secret).content-id: CodeSpell content identifier.language: Submission language code (for exampleJAVA).source-path: Path to the directory to collect source files from (default:.).exclude-paths: Optional comma-separated list of path prefixes to ignore (e.g.test,docs).
submission-id: The ID returned by the CodeSpell API for the created submission (if available).
name: Submit to CodeSpellon:
push:
branches:
- mainjobs:
submit:
runs-on: ubuntu-lateststeps:
- name: Check out repositoryuses: actions/checkout@v4
- id: submitname: Create CodeSpell submissionuses: code-spell/codespell-submission-action@v1with:
api-url: https://api.codespell.netauth-url: https://auth.codespell.netauth-realm: codespell-produsername: ${{ secrets.CODESPELL_USERNAME }}password: ${{ secrets.CODESPELL_PASSWORD }}content-id: 82587fa8-aed5-4ef0-90f6-7a2894ceb7c4language: JAVAsource-path: srcexclude-paths: test,docs
- name: Show submission idrun: echo "Submission ID: ${{ steps.submit.outputs.submission-id }}"You can find an example repository using this action at Library Management System.
- The action expects Node 20, which is available on current GitHub-hosted runners.
- Files larger than 65535 bytes are skipped and will emit a warning.