이 구성으로 github 작업을 사용합니다.
name: Node CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: install node
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: npm install
run: npm install
- name: npm build
run: npm run build --if-present
- name: npm test
run: npm test
- name: make storybook
run: npm run build-storybook
- uses: dswistowski/surge-sh-action@v1
with:
domain: 'https://react-strix-$(git rev-parse --short HEAD).surge.sh'
project: '.out'
login: [email protected]
token: ${{ secrets.SURGE_PASSWORD }}
- name: deploy image
run: |
docker login docker.pkg.github.com --username straxico --password ${{ secrets.DOCKER_PASSWORD }}
docker build . --file Dockerfile --tag docker.pkg.github.com/straxico/react-strix/master:$(git describe --tags)
docker push docker.pkg.github.com/straxico/react-strix/master:$(git describe --tags)
내 스토리 북과 도커 URL이 포함 된 최신 푸시 커밋에 대한 댓글을 자동으로 만들고 싶습니다. "지금"봇처럼
github 작업으로 커밋에 대한 주석을 어떻게 작성할 수 있습니까?
업데이트 : 커밋 주석 작성을 단순화하는 작업을 작성했습니다. 참조를 위해 아래의 원래 솔루션을 남겨 두겠습니다.
자세한 사용법 은 커밋 주석 을 참조 하십시오.
- name: Create commit comment
uses: peter-evans/commit-comment@v1
with:
body: |
This is a multi-line test comment
- With GitHub **Markdown**
- Created by [commit-comment][1]
[1]: https://github.com/peter-evans/commit-comment
원래 솔루션 : 다음 워크 플로는 좋은 시작점이 될 것입니다. API에 대한 전체 문서는 https://developer.github.com/v3/repos/comments/#create-a-commit-comment 에서 찾을 수 있습니다.
name: commit comment
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Add commit comment
run: |
jq -nc '{"body": "test comment"}' | \
curl -sL -X POST -d @- \
-H "Content-Type: application/json" \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/comments"
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다