์ฝ๋ ์ฃผ์ ์ ๋ณด
์ฝ๋ ์ฃผ์์ ์ฝ๋ ์์๊ฐ ์ํํ๋ ์์ ๊ณผ ์ด์ ๋ฅผ ์ค๋ช ํ์ฌ ๋ ๊ธด ์ฝ๋ ์์๋ฅผ ์ค๋ช ํ๋ ๋ฐ ๋์์ด ๋ฉ๋๋ค. ์ฃผ์์ ๋ ๊ฐ์ ์ฐฝ ๋ ์ด์์์ ์ฝ๋ ์์ ์์ ๋ ๋๋ง๋๋ฏ๋ก ์ฝ๋ ์์ฒด์ ๊ฐ๋ ์ฑ์ ํด์น์ง ์์ผ๋ฉด์ ๋ ๊ธด ์ฃผ์์ ์์ฑํ ์ ์์ต๋๋ค. ์ฝ๋ ์กฐ๊ฐ์ด ์๋ ์ ์ฒด ์ฝ๋ ์์์๋ง ์ฃผ์์ ์ถ๊ฐํฉ๋๋ค. ์ฝ๋ ์ฃผ์์ ๋ชจ๋ ์ฝ๋ ์์์ ํ์ํ์ง ์์ผ๋ฉฐ ๋ฐ๋์ ํ์ํ ๊ฒฝ์ฐ์๋ง ์ฌ์ฉํด์ผ ํฉ๋๋ค.
์ฝ๋ ์ฃผ์์ ๋ค์ํ ๋์ ๊ทธ๋ฃน์ ์ ์ฉํ ์ ์์ต๋๋ค. ์ฝ๋ ์ฃผ์์ ์ข ์ข ์ ๊ท ์ฌ์ฉ์์๊ฒ ์ฃผ์ ๊ฐ๋ ์ ์ค๋ช ํ๊ฑฐ๋ ๊ฒฝํ์ด ํ๋ถํ ์ฌ์ฉ์์๊ฒ ํน์ ์ ํ์ง๋ฅผ ์ค๋ช ํ๋ ๋ฐ ์ฌ์ฉ๋ฉ๋๋ค.
์ ์ฌ์ฉ์์๊ฒ ์ฝ๋ ์ฃผ์์ ์ฝ๋ ์์์ ๊ฐ๋ต์ ์ธ ๊ฐ์๋ฅผ ๋์ด ๊ฐ ์ฝ๋ ์ค์ด ์ํํ๋ ์์ ์ ์ค๋ช ํ์ฌ ์น๊ตฌ๋ ๋๋ฃ๊ฐ ์ฝ๋๋ฅผ ์๋ดํ๋ ๊ฒ์ฒ๋ผ ์ฝ๋๋ฅผ ์ดํดํ ์ ์๋๋ก ํ๋ ๋ฐฉ๋ฒ์ ๋๋ค.
๊ฒฝํ์ด ๋ง์ ์ฌ์ฉ์์๊ฒ ์ฝ๋ ์ฃผ์์ ์ฝ๋ ์์๋ฅผ ์ดํดํ๊ณ ํน์ ์๊ตฌ ์ฌํญ์ ๋ง๊ฒ ์กฐ์ ํ๋ ๋ฐ ๋์์ด ๋ ์ ์์ต๋๋ค. ์ฃผ์์ ์ฝ๋๊ฐ ํน์ ๋ฐฉ์์ผ๋ก ์์ฑ๋ ์ด์ ๋ฅผ ์ค๋ช ํ์ฌ ๊ธฐ๋ณธ ์ฌํญ์ด ๋ช ํํด์ง๋๋ก ํฉ๋๋ค.
๋จ์ผ ๋ฌธ์์์ ์ฌ๋ฌ ์ฝ๋ ์์์ ์ฃผ์์ ๋ฌ ์ ์์ง๋ง, ๊ฐ ์ฃผ์์ ๋ฌธ์์ ๋ณต์ก์ฑ์ ์ฆ๊ฐ์ํค๊ณ ํ๋ฉด ์ฝ๊ธฐ ํ๋ก๊ทธ๋จ์ ์ฌ์ฉํ๋ ์ฌ์ฉ์์ ๋ํ ๋ฐ๋ณต์ ์ธ ํ์ ์์ ์ ์ถ๊ฐํฉ๋๋ค. ๋ฌธ์์ ์ฌ๋ฌ ์ฝ๋ ์์๊ฐ ์๋ ๊ฒฝ์ฐ, ๋จ์ผ ์์๋ก ๊ฒฐํฉํ ์ ์๋์ง ์ฌ๋ถ๋ฅผ ๊ณ ๋ คํฉ๋๋ค.
์ฝ๋ ์ฃผ์ ์ฌ์ฉ ๋ฐ ์ถ๊ฐํ๊ธฐ
- ๋ฌธ์์
layout: inline
ํ๋ฐํธ ๋งคํฐ ์์ฑ์ ์ง์ ํ์ธ์. - ์ผ์ค ๋ฐฑํฑ์ ์ฌ์ฉํ์ฌ ์ฝ๋ ์์๋ฅผ ๋ง๋์ธ์.
- 3์ค ๋ฐฑํฑ ๋ค์ ๋ค์
annotate
์(๋ฅผ) ์๋ ์ฝ๋ ์์์ ๋ํ ์ธ์ด๋ฅผ ์ง์ ํ์ธ์. ์๋ฅผ ๋ค์ด```yaml annotate
๋๋```ruby annotate
์ ๋๋ค. - ์ฝ๋ ์์ ๋ด์์ ์ฃผ์ ํ๊ทธ(
#
,//
,<!--
,%%
)๋ฅผ ์ฌ์ฉํ์ฌ ์ฃผ์์ ์ถ๊ฐํฉ๋๋ค. ์ฝ๋ ์ํ์ด ์์ฑ๋ ์ธ์ด์๋ ์ฃผ์ ํ๊ทธ๋ฅผ ์ฌ์ฉํด์ผ ํฉ๋๋ค. ์๋ฅผ ๋ค์ด YAML์๋#
์ด๊ณ JavaScript์๋//
์ ๋๋ค.- ์ฃผ์์ด ์ถ๊ฐ๋ ์ฝ๋ ์์๋ ๋ฐ๋์ ํ ์ค ์ฃผ์์ผ๋ก ์์ํด์ผ ํฉ๋๋ค. ์ฒซ ๋ฒ์งธ ์ฝ๋ ์ค์ ์ฃผ์์ ์ถ๊ฐํ์ง ์์ผ๋ ค๋ฉด ๋น ์ฃผ์์ผ๋ก ์์ํ๋ฉด ๋ฉ๋๋ค.
- ์ฃผ์์ ์ฃผ์ ํ๊ทธ ์๋ ์ค์ ์ฝ๋์์ ๋ค์ ์ฃผ์ ํ๊ทธ ๋๋ ์ฝ๋ ๋ธ๋ก์ ๋์ ์ ์ฉํฉ๋๋ค.
์ฃผ์ ๊ท์น
๋ค์์ ๊ท์น์ ๋ชจ๋ ์ฝ๋ ์ฃผ์์ ์ ์ฉ๋ฉ๋๋ค.
/*
์ฒ๋ผ ์ฌ๋ฌ ์ค ์คํ์ผ์ ์ฃผ์์ ์ง์๋์ง ์์ต๋๋ค.- ์ฝ๋ ์ฃผ์์ ์์ํ๋ ๊ธฐํธ์ ์ฃผ์ ์ฌ์ด์๋ ๊ณต๋ฐฑ์ด ์์ด์ผ ํฉ๋๋ค.
- ์ฌ๋ฐ๋ฅธ ์ฌ์ฉ:
# comment
- ์๋ชป๋ ์ฌ์ฉ:
#comment
- ์ฌ๋ฐ๋ฅธ ์ฌ์ฉ:
- ๋น ์ฃผ์์ ๋ง๋ค๋ ค๋ฉด ๊ทธ ๋ค์ ํ ์คํธ๊ฐ ์๋ ์ค๋ช ํ๊ทธ๋ฅผ ์ฝ์ ํ์ธ์. ๋น ์ฃผ์์ ์ํ์ ์ผ๋ถ ์ค์์ ์ฃผ์์ด ํ์ํ์ง ์์ ๊ฒฝ์ฐ์ ์ ์ฉํฉ๋๋ค.
#!
๋ก ์์ํ๋ ๋ฌธ์์ด์ ์ฝ๋ ๋ธ๋ก์์ ๋ ๋๋ง๋๋ฉฐ ์ฃผ์์ผ๋ก ์ฒ๋ฆฌ๋์ง ์์ต๋๋ค.- ์ค๋ช ํ๊ทธ ๋ค์ ๋ชจ๋ ํญ๋ชฉ์ Markdown์ผ๋ก ๊ตฌ๋ฌธ ๋ถ์๋ ๊ฒ์ ๋๋ค. ๋งํฌ, ๋ฒ์ ๊ด๋ฆฌ ๋ฐ ๊ธฐํ ์คํ์ผ์ Markdown์ ์์ฑ๋ ๊ฒ์ฒ๋ผ ๋ ๋๋ง๋ ๊ฒ์ ๋๋ค.
- ์ฌ๋ฌ ์์ฐจ ์ค๋ช ์ ๋จ์ผ ์ฃผ์์ ๋ง๋ญ๋๋ค.
- ์ค๋ช ํ๊ทธ๋ก ์์ํ์ง ์๊ณ ๋น์ด ์๊ฑฐ๋ ๊ณต๋ฐฑ๋ง ํฌํจ๋ ์ค์ ๋ฌด์๋ ๊ฒ์ ๋๋ค.
- ๋จ์ผ ์ค์ ์ค๋ช ์ ์ฌ์ฉํ์ฌ ์ฝ๋ ๊ตฌ์ญ์ ์์ํด์ผ ํฉ๋๋ค. ์ฝ๋์ ์ฒซ ๋ฒ์งธ ์ค(๋๋ ๊ตฌ์ญ)์ ์ฃผ์์ด ํ์ํ์ง ์์ ๊ฒฝ์ฐ ํ ์คํธ๊ฐ ์๋ ์ค๋ช ํ๊ทธ๋ฅผ ์ฌ์ฉํ์ฌ ๋น ์ฃผ์์ ๋ง๋ค ์ ์์ต๋๋ค.
- HTML ์คํ์ผ์ ๊ฒฝ์ฐ ์ฃผ์ ๋ค์ ๋ซ๋ ํ๊ทธ
<!-- -->
์(๋ฅผ) ํฌํจํ์ฌ, ๊ตฌ๋ฌธ ๊ฐ์กฐ ํ์๋ฅผ ์ ์ง ๊ด๋ฆฌํฉ๋๋ค.
์ฝ๋ ์ฃผ์ ๋ชจ๋ฒ ์ฌ๋ก
์ฝ๋ ๋ธ๋ก ์์ ์๊ฐ๋ฅผ ์ฌ์ฉํ์ฌ ์ฝ๋ ์์์ ์ ์ฒด ์ฉ๋๋ฅผ ์๊ฐํ๊ณ ์ฃผ์์ ์ฌ์ฉํ์ฌ ํน์ ์ฝ๋ ์ค์ด ํ๋ ์์ ๊ณผ ํด๋น ์ฝ๋ ์ค์ด ์ํํ๋ ์ด์ ๋ฅผ ์ค๋ช ํฉ๋๋ค.
์ฝ๋ ์ฃผ์์ ์ต๋ํ ์งง๊ฒ ์ ์งํ๋ ๋์ ์ฝ๋ ์ฃผ์์ ๋ช ํ์ฑ ์ฐ์ ์์๋ฅผ ์ง์ ํ์ธ์. ์ฝ๋ ์ํ์ ์์ ์ ์์ ์ ๋ํ ๊ธฐ์ด๋ก ์ฌ์ฉํ๋ฏ๋ก, ์ฃผ์์ ์์ฑ๋๋ ์ํ๊ณผ ๋ค๋ฅธ ์ฉ๋์ ๋ง๊ฒ ์ํ์ ์กฐ์ ํ๋ ๋ฐฉ๋ฒ์ ์ดํดํ๋ ๋ฐ ๋์์ด ๋ฉ๋๋ค.
์ฝ๋ ์ฃผ์์ ์์ฑํ ๋ ๋์ ๊ทธ๋ฃน์ ๊ณ ๋ คํ๊ณ ์์๊ฐ ํน์ ๋ฐฉ์์ผ๋ก ์์ฑ๋ ์ด์ ๋ฅผ ์ฌ๋๋ค์ด ์ ๊ฒ์ด๋ผ๊ณ ๊ฐ์ ํ์ง ๋ง์ธ์.
์ฃผ์์ ์ฃผ์์ด ๋ฌ๋ฆฐ ์ฝ๋์ ์์ ๊ฒฐ๊ณผ๋ฅผ ํ์ํ๋ ๋ฐ ์ฌ์ฉ๋ ์ ์์ง๋ง, ์ ์ฒด ์ฝ๋ ์์์ ๊ฒฐ๊ณผ๋ ๋์ ๊ทธ๋ฃน์๊ฒ ๊ฐ์ฅ ์ ํฉํ ๋ฐฉ๋ฒ์ด์ด์ผ ํ๋ฉฐ, ์ฌ๊ธฐ์๋ ์ฝ๋ ์์ ์๊ฐ ๋๋ ์์ ๋ค์์ ์ค๋ช ํ๋ ๋ฐฉ๋ฒ์ด ์์ต๋๋ค.
์ฝ๋ ์์๊ฐ ๋ณ๊ฒฝ๋๋ฉด ๋ชจ๋ ์ฃผ์์ด ์ฌ์ ํ ์ ํจํ์ง ๊ฒ์ฌํ์ธ์.
์ฃผ์์ด ์ถ๊ฐ๋ ์ฝ๋ ์์์ ์์
๋ค์ ์์์์๋ ๋ ๋๋ง๋ ์ฝ๋ ์ฃผ์์ ๋ชจ์๊ณผ ํด๋น ์ฃผ์์ ๋ง๋๋ ์์ ์ฝ๋๋ฅผ ๋ณด์ฌ ์ค๋๋ค.
๋ ๋๋ง ์์
๋ค์ ์ฝ๋ ์์๋ ๋์ด์ค๊ธฐ ์์ฒญ์ด ์ด๋ฆด ๋ ํ์ ๋ฉ๋ชจ๋ฅผ ๊ฒ์ํ๋ ์ํฌํ๋ก์ ๋๋ค.
# The name of the workflow as it will appear in the "Actions" tab of the GitHub repository. name: Post welcome comment # The `on` keyword lets you define the events that trigger when the workflow is run. on: # Add the `pull_request` event, so that the workflow runs automatically # every time a pull request is created. pull_request: types: [opened] # Modifies the default permissions granted to `GITHUB_TOKEN`. permissions: pull-requests: write # Defines a job with the ID `build` that is stored within the `jobs` key. jobs: build: name: Post welcome comment # Configures the operating system the job runs on. runs-on: ubuntu-latest # The `run` keyword tells the job to execute a command on the runner. steps: - run: gh pr comment $PR_URL --body "Welcome to the repository!" env: GH_TOKEN: $ PR_URL: $
name: Post welcome comment
The name of the workflow as it will appear in the "Actions" tab of the GitHub repository.
on:
The on
keyword lets you define the events that trigger when the workflow is run.
pull_request:
types: [opened]
Add the pull_request
event, so that the workflow runs automatically
every time a pull request is created.
permissions:
pull-requests: write
Modifies the default permissions granted to GITHUB_TOKEN
.
jobs:
build:
name: Post welcome comment
Defines a job with the ID build
that is stored within the jobs
key.
runs-on: ubuntu-latest
Configures the operating system the job runs on.
steps:
- run: gh pr comment $PR_URL --body "Welcome to the repository!"
env:
GH_TOKEN: $
PR_URL: $
The run
keyword tells the job to execute a command on the runner.
# The name of the workflow as it will appear in the "Actions" tab of the GitHub repository.
name: Post welcome comment
# The `on` keyword lets you define the events that trigger when the workflow is run.
on:
# Add the `pull_request` event, so that the workflow runs automatically
# every time a pull request is created.
pull_request:
types: [opened]
# Modifies the default permissions granted to `GITHUB_TOKEN`.
permissions:
pull-requests: write
# Defines a job with the ID `build` that is stored within the `jobs` key.
jobs:
build:
name: Post welcome comment
# Configures the operating system the job runs on.
runs-on: ubuntu-latest
# The `run` keyword tells the job to execute a command on the runner.
steps:
- run: gh pr comment $PR_URL --body "Welcome to the repository!"
env:
GH_TOKEN: $
PR_URL: $
์์ ์ฝ๋ ์์
The following code example shows a workflow that posts a welcome comment on a pull request when it is opened.
```yaml annotate
# The name of the workflow as it will appear in the "Actions" tab of the GitHub repository.
name: Post welcome comment
# The `on` keyword lets you define the events that trigger when the workflow is run.
on:
# Add the `pull_request` event, so that the workflow runs automatically
# every time a pull request is created.
pull_request:
types: [opened]
# Modifies the default permissions granted to `GITHUB_TOKEN`.
permissions:
pull-requests: write
# Defines a job with the ID `build` that is stored within the `jobs` key.
jobs:
build:
name: Post welcome comment
# Configures the operating system the job runs on.
runs-on: ubuntu-latest
# The `run` keyword tells the job to execute a command on the runner.
steps:
- run: gh pr comment $PR_URL --body "Welcome to the repository!"
env:
GH_TOKEN: $
PR_URL: $
```