agentsclimarketplace

Github actions

Skill DaleStudy/skills/skills/github-actions

๐Ÿ› ๏ธ ์—์ด์ „ํŠธ ์Šคํ‚ฌ

Install
npx -y skills add DaleStudy/skills --skill github-actions

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

GitHub Actions ์›Œํฌํ”Œ๋กœ์šฐ ์ƒ์„ฑ, ๋ณด์•ˆ ๋ฐ ๋ฒ„์ „ ๊ด€๋ฆฌ ์Šคํ‚ฌ. ๋‹ค์Œ ์ƒํ™ฉ์—์„œ ์‚ฌ์šฉ: (1) ์ƒˆ ์›Œํฌํ”Œ๋กœ์šฐ ํŒŒ์ผ(.yml) ์ž‘์„ฑ ์‹œ, (2) ๊ธฐ์กด ์›Œํฌํ”Œ๋กœ์šฐ ์ˆ˜์ • ์‹œ, (3) ์•ก์…˜ ๋ฒ„์ „ ๊ฒ€ํ†  ๋˜๋Š” ์—…๋ฐ์ดํŠธ ์‹œ, (4) CI/CD ๋ณด์•ˆ ๊ฐ์‚ฌ ์‹œ, (5) 'actions/', 'uses:', 'workflow', '.github/workflows' ํ‚ค์›Œ๋“œ๊ฐ€ ํฌํ•จ๋œ ์ž‘์—… ์‹œ

The file declares its own license as MIT. That is the authorโ€™s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

6.4 KB, as published. Nobody here has run it

GitHub Actions

์ฐธ๊ณ : GitHub Actions ์›Œํฌํ”Œ๋กœ์šฐ ์‹คํ–‰ ๋ฐ ๊ฒฐ๊ณผ ์กฐํšŒ, ์ด์Šˆ/PR ๊ด€๋ฆฌ ๋“ฑ gh CLI ๊ด€๋ จ ์ž‘์—…์€ github ์Šคํ‚ฌ์„ ํ•จ๊ป˜ ๋กœ๋“œํ•˜์—ฌ ์ฐธ์กฐํ•œ๋‹ค.

์ฃผ์˜ ์‚ฌํ•ญ (Anti-patterns)

1. ์˜ค๋ž˜๋œ ๋ฒ„์ „ ์‚ฌ์šฉ

# โŒ ์˜ค๋ž˜๋œ ๋ฒ„์ „ - ๊ฐ€์žฅ ํ”ํ•œ ์‹ค์ˆ˜
uses: actions/checkout@v4 # v6๊ฐ€ ์ตœ์‹ ์ธ ๊ฒฝ์šฐ

# โœ… ์ตœ์‹  ๋ฉ”์ด์ € ๋ฒ„์ „ (gh release view๋กœ ํ™•์ธ ํ›„ ์‚ฌ์šฉ)
uses: actions/checkout@v6

์ตœ์‹  ๋ฒ„์ „์—์„œ ์ œ๊ณตํ•˜๋Š” ์„ฑ๋Šฅ ๊ฐœ์„ ๊ณผ ๋ณด์•ˆ ํŒจ์น˜๋ฅผ ๋†“์น˜์ง€ ์•Š๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.

๋ฒ„์ „ ํ™•์ธ ๋ช…๋ น์–ด:

gh release view --repo {owner}/{repo} --json tagName --jq '.tagName'

# ์˜ˆ์‹œ
gh release view --repo actions/checkout --json tagName --jq '.tagName'
gh release view --repo oven-sh/setup-bun --json tagName --jq '.tagName'

์ฐธ๊ณ : ๋ณด์•ˆ ๋ฏผ๊ฐ ํ™˜๊ฒฝ์ด๋‚˜ ์‹ ๋ขฐ๋„ ๋‚ฎ์€ ์„œ๋“œํŒŒํ‹ฐ ์•ก์…˜์€ SHA ํ”ผ๋‹(@a1b2c3...)์„ ๊ณ ๋ ค.

2. ๋ฏผ๊ฐ์ •๋ณด ํ•˜๋“œ์ฝ”๋”ฉ

# โŒ ํ•˜๋“œ์ฝ”๋”ฉ - ๋ณด์•ˆ ์œ„ํ—˜
env:
  API_KEY: "sk-1234567890"
  DATABASE_PASSWORD: "mypassword123"
# โœ… secrets ์‚ฌ์šฉ
env:
  API_KEY: ${{ secrets.API_KEY }}
  DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }}

๋น„๋ฐ€๋ฒˆํ˜ธ๋‚˜ API Key์™€ ๊ฐ™์€ ๋ฏผ๊ฐ ์ •๋ณด๊ฐ€ ๊ทธ๋Œ€๋กœ ๋…ธ์ถœ๋˜์–ด ๋ณด์•ˆ ์‚ฌ๊ณ ๋กœ ์ด์–ด์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ณด์•ˆ ์ƒ ์ค‘์š”ํ•œ ์ •๋ณด๋Š” ๋ฐ˜๋“œ์‹œ ์ €์žฅ์†Œ๋‚˜ ์กฐ์ง์˜ ์‹œํฌ๋ฆฟ์œผ๋กœ ์ €์žฅํ•ด๋†“๊ณ  ์ฝ์–ด ์™€์•ผํ•ฉ๋‹ˆ๋‹ค.

์ฐธ๊ณ : Using secrets

3. ์ž…๋ ฅ๊ฐ’ ์ธ์ ์…˜ ์ทจ์•ฝ์ 

# โŒ ์ธ์ ์…˜ ์ทจ์•ฝ - github.event ์ง์ ‘ ์‚ฌ์šฉ
run: echo "${{ github.event.issue.title }}"
run: gh issue comment ${{ github.event.issue.number }} --body "${{ github.event.comment.body }}"
# โœ… ํ™˜๊ฒฝ๋ณ€์ˆ˜๋กœ ์ „๋‹ฌํ•˜์—ฌ ์ธ์ ์…˜ ๋ฐฉ์ง€
env:
  ISSUE_TITLE: ${{ github.event.issue.title }}
  COMMENT_BODY: ${{ github.event.comment.body }}
run: |
  echo "$ISSUE_TITLE"
  gh issue comment ${{ github.event.issue.number }} --body "$COMMENT_BODY"

์•…์˜์ ์ธ ์‚ฌ์šฉ์ž๊ฐ€ ์ด์Šˆ ์ œ๋ชฉ์ด๋‚˜ ์ฝ”๋ฉ˜ํŠธ์— ์…ธ ๋ช…๋ น์–ด๋ฅผ ์ฃผ์ž…ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ฐธ๊ณ : Script injections

4. pull_request_target ์ด๋ฒคํŠธ ์˜ค์šฉ

# โš ๏ธ ์œ„ํ—˜ - ํฌํฌ์˜ ์ฝ”๋“œ๋ฅผ ์‹ ๋ขฐ๋œ ์ปจํ…์ŠคํŠธ์—์„œ ์‹คํ–‰
on: pull_request_target
steps:
  - uses: actions/checkout@v{N}
    with:
      ref: ${{ github.event.pull_request.head.sha }} # ์œ„ํ—˜!

pull_request_target ์ด๋ฒคํŠธ๋Š” ํฌํฌ์˜ PR์—์„œ๋„ ์‹œํฌ๋ฆฟ์— ์ ‘๊ทผ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. ํฌํฌ ์ฝ”๋“œ๋ฅผ ์ฒดํฌ์•„์›ƒํ•˜๋ฉด ์•…์„ฑ ์ฝ”๋“œ๊ฐ€ ์‹คํ–‰๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ฐธ๊ณ : pull_request_target

5. ์‚ฌ์ „ ์„ค์น˜๋œ ๋„๊ตฌ์— ์ค‘๋ณต ์„ค์ •

# โŒ ๋ถˆํ•„์š”ํ•œ setup - node, npm, npx๋Š” ์ด๋ฏธ ์„ค์น˜๋จ
steps:
  - uses: actions/setup-node@v{N}
  - run: npx some-command
# โœ… ๋ฐ”๋กœ ์‚ฌ์šฉ
steps:
  - run: npx some-command
  - run: python script.py
  - run: docker build .

์ค‘๋ณต ์„ค์น˜๋Š” ์›Œํฌํ”Œ๋กœ์šฐ ์‹คํ–‰ ์‹œ๊ฐ„์„ ๋Š˜๋ฆฌ๊ณ  ๋ถˆํ•„์š”ํ•œ ๋„คํŠธ์›Œํฌ ์š”์ฒญ์„ ๋ฐœ์ƒ์‹œํ‚ต๋‹ˆ๋‹ค.

์ฃผ์š” ์‚ฌ์ „ ์„ค์น˜ ๋„๊ตฌ: Node.js, npm, npx, Python, pip, Ruby, gem, Go, Docker, git, gh, curl, wget, jq, yq

์ฃผ์š” ๋ฏธ์„ค์น˜ ๋„๊ตฌ: Bun, Deno, Rust, Zig, pnpm, Poetry, Ruff

์‚ฌ์ „ ์„ค์น˜๋œ ๋„๊ตฌ ํ™•์ธ:

๋ชจ๋ฒ” ์‚ฌ๋ก€ (Best Practices)

์ตœ์†Œ ๊ถŒํ•œ ์›์น™

๊ถŒํ•œ์€ ๊ฐ€๋Šฅํ•œ ํ•˜์œ„ ๋ ˆ๋ฒจ์— ์„ ์–ธ. ๋ฒ”์œ„๋ฅผ ์ข๊ฒŒ ์œ ์ง€:

# โœ… ๊ถŒํ•œ ๋ฒ”์œ„: workflow > job > step (์ข์„์ˆ˜๋ก ์ข‹์Œ)
jobs:
  build:
    permissions:
      contents: read # job ๋ ˆ๋ฒจ์—์„œ ํ•„์š”ํ•œ ๊ถŒํ•œ๋งŒ

์ฐธ๊ณ : Modifying the permissions for the GITHUB_TOKEN

๊ถŒ์žฅ ์›Œํฌํ”Œ๋กœ์šฐ ๊ตฌ์กฐ

name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  build:
    runs-on: ubuntu-latest
    permissions:
      contents: read

    steps:
      # ๋ฒ„์ „์€ gh release view๋กœ ํ™•์ธ ํ›„ ์‚ฌ์šฉ
      - uses: actions/checkout@v{N}

      - name: Setup Bun
        uses: oven-sh/setup-bun@v{N}

์ž์ฃผ ์‚ฌ์šฉ๋˜๋Š” ์ด๋ฒคํŠธ

on:
  push: # ํ‘ธ์‹œ ์‹œ
    branches: [main]
  pull_request: # PR ์ƒ์„ฑ/์—…๋ฐ์ดํŠธ ์‹œ
    branches: [main]
  workflow_dispatch: # ์ˆ˜๋™ ์‹คํ–‰
  schedule: # ์Šค์ผ€์ค„ ์‹คํ–‰
    - cron: "0 0 * * 1" # ๋งค์ฃผ ์›”์š”์ผ 00:00 UTC
  release: # ๋ฆด๋ฆฌ์Šค ์ƒ์„ฑ ์‹œ
    types: [published]
  workflow_call: # ๋‹ค๋ฅธ ์›Œํฌํ”Œ๋กœ์šฐ์—์„œ ํ˜ธ์ถœ

์ž์ฃผ ์‚ฌ์šฉ๋˜๋Š” ๊ถŒํ•œ

permissions:
  contents: read        # CI (๋นŒ๋“œ/ํ…Œ์ŠคํŠธ), ์ฝ”๋“œ ์ฒดํฌ์•„์›ƒ
  contents: write       # ์ปค๋ฐ‹/ํ‘ธ์‹œ
  pull-requests: write  # PR ์ฝ”๋ฉ˜ํŠธ ๋ด‡
  issues: write         # ์ด์Šˆ ์ฝ”๋ฉ˜ํŠธ
  packages: write       # ํŒจํ‚ค์ง€ ๋ฐฐํฌ (contents: write์™€ ํ•จ๊ป˜)
  id-token: write       # OIDC ํด๋ผ์šฐ๋“œ ์ธ์ฆ (contents: read์™€ ํ•จ๊ป˜)

์ž์ฃผ ์‚ฌ์šฉ๋˜๋Š” ์•ก์…˜

# ๋ฒ„์ „์€ gh release view --repo {owner}/{repo} --json tagName --jq '.tagName'์œผ๋กœ ํ™•์ธ
steps:
  - uses: actions/cache@v{N} # ์˜์กด์„ฑ ์บ์‹ฑ
  - uses: actions/checkout@v{N} # ์ฝ”๋“œ ์ฒดํฌ์•„์›ƒ
  - uses: actions/download-artifact@v{N} # ์•„ํ‹ฐํŒฉํŠธ ๋‹ค์šด๋กœ๋“œ
  - uses: actions/upload-artifact@v{N} # ์•„ํ‹ฐํŒฉํŠธ ์—…๋กœ๋“œ
  - uses: oven-sh/setup-bun@v{N} # Bun ์„ค์ •

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.