npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hello-github-actions

v1.13.0

Published

hack github actions

Downloads

12

Readme

hackga

npm

Read Publishing packages to the npm registry first.

GitHub Actions 支持多種類型的 secrets,主要包括:

  1. Repository Secrets: 這些 secrets 設置在特定倉庫的層級,只對該倉庫內的 GitHub Actions 工作流程有效。這些 secrets 適合儲存特定於該倉庫的敏感資料,如 API 密鑰、環境變數等。

    範例:設置一個名為 API_KEY 的 Repository Secret 用於存取第三方服務。

    env:
      SOME_API_KEY: ${{ secrets.API_KEY }}
  2. Organization Secrets: 這些 secrets 設置在組織層級,可以在組織內的多個倉庫之間共享。這些 secrets 適合儲存對於整個組織而言是通用的敏感資訊,例如用於跨多個項目的訪問令牌。

    範例:在組織層級設置一個名為 ORG_LEVEL_SECRET 的 secret。

    env:
      GLOBAL_TOKEN: ${{ secrets.ORG_LEVEL_SECRET }}
  3. Environment Secrets: 這些 secrets 是與特定環境(例如 'production'、'development'、'staging')相關聯。當工作流程運行在指定環境時,這些 secrets 才會被使用。這些 secrets 適合用於儲存特定於環境的敏感資料。

    範例:在 'production' 環境中設置一個名為 PROD_DB_PASSWORD 的 secret。

    jobs:
      deploy:
        runs-on: ubuntu-latest
        environment: production
        steps:
          - run: echo "Deploying to production"
            env:
              DB_PASSWORD: ${{ secrets.PROD_DB_PASSWORD }}
  4. Dependabot Secrets:這些是專門為 Dependabot 設置的 secrets,用於在自動合併請求時訪問私有依賴項或其他需要認證的資源。

    範例:設置一個名為 DEPENDABOT_SECRET 的 secret,供 Dependabot 使用以訪問私有倉庫。

    # 通常在 Dependabot 的配置文件中指定
    registries:
      npm-registry:
        type: npm-registry
        url: https://registry.npmjs.org
        token: ${{ secrets.DEPENDABOT_SECRET }}

每種 secret 都用於不同的情境,選擇哪一種取決於你需要保護的資料的性質和範圍。在使用這些 secrets 時,應始終謹慎,確保只有必要的工作流程或角色可以訪問相關的敏感資訊。

在 GitHub Actions 中,如果相同的變數名稱出現在不同類型的 secrets(如 Repository Secrets、Organization Secrets、Environment Secrets)中,則它們的生效優先順序如下:

  1. Environment Secrets: 最高優先級。如果一個變數在環境級別設置了 secret,則該值將被使用。
  2. Repository Secrets: 若在環境級別沒有找到該 secret,則會檢查倉庫級別的 secrets。
  3. Organization Secrets: 如果在環境級別和倉庫級別都沒有找到,則會使用組織級別的 secret。

這意味著,如果相同的變數名稱在多個層級定義了不同的值,GitHub Actions 將根據上述的優先順序選擇使用哪一個值。通常情況下,更具體(如環境級別)的設置會覆蓋更廣泛(如組織級別)的設置。