๐Ÿ“ฆ rust-lang / crates-io-auth-action

Get a crates.io temporary access token

โ˜… 28 stars โ‘‚ 4 forks ๐Ÿ‘ 28 watching โš–๏ธ Apache License 2.0
๐Ÿ“ฅ Clone https://github.com/rust-lang/crates-io-auth-action.git
HTTPS git clone https://github.com/rust-lang/crates-io-auth-action.git
SSH git clone git@github.com:rust-lang/crates-io-auth-action.git
CLI gh repo clone rust-lang/crates-io-auth-action
renovate[bot] renovate[bot] Merge pull request #168 from rust-lang/renovate/typescript-eslint-monorepo bf95dfc 18 hours ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ .github
๐Ÿ“ dist
๐Ÿ“ mock
๐Ÿ“ src
๐Ÿ“„ .gitattributes
๐Ÿ“„ .gitignore
๐Ÿ“„ .node-version
๐Ÿ“„ .prettierignore
๐Ÿ“„ .prettierrc.json
๐Ÿ“„ action.yml
๐Ÿ“„ CODE_OF_CONDUCT.md
๐Ÿ“„ CONTRIBUTING.md
๐Ÿ“„ eslint.config.mjs
๐Ÿ“„ LICENSE-APACHE
๐Ÿ“„ LICENSE-MIT
๐Ÿ“„ package.json
๐Ÿ“„ pnpm-lock.yaml
๐Ÿ“„ README.md
๐Ÿ“„ tsconfig.base.json
๐Ÿ“„ tsconfig.json
๐Ÿ“„ tsdown.config.ts
๐Ÿ“„ README.md

crates-io-auth-action

Get a temporary access token to interact with crates.io using trusted publishing.

Usage

This action retrieves a token from crates.io and sets it as an output variable. You can read the token from the action's token output and use it in subsequent steps. The action's post step automatically revokes the token when the job completes.

To learn how to use this action and configure your crates, read the crates.io documentation.

Using a Different Registry URL

If you want to use a different URL than the default https://crates.io, you can specify it in the url input. For example, to use the crates.io staging environment:

- name: Authenticate with custom registry
  id: auth
  uses: rust-lang/crates-io-auth-action@v1
  with:
    url: https://staging.crates.io

Sequence Diagram

sequenceDiagram
    participant GW as GitHub Workflow
    participant GH as github.com
    participant CR as crates.io


    GW->>GH: Request JWT token
    GH-->>GW: Return JWT token

    GW->>CR: Send JWT
    CR-->>GW: Return temporary token

    GW->>GW: User uses the temporary token in their steps

    GW->>CR: Revoke temporary token

License

This project is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.