GiitHub Actions를 사용하여 GiitHub Issue를 계산기로 사용
3020 단어 GitHub Actionstech
다음은 Issue를 사용한 계산
1 + 2 * (3 + 4) / 5 = 3.8
입니다.이것을 실현하기 위해 아래의 워크플로우를 준비하면 됩니다.
.github/workflows/dentaku.yml
name: Dentaku
on:
issues:
types: opened
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: calculate
run: |
ans=$(echo "${{ github.event.issue.title }}" | bc -l)
echo "::set-output name=ANS::${ans}"
- uses: actions-ecosystem/action-create-comment@v1
with:
github_token: ${{ secrets.github_token }}
body: |
${{ steps.calculate.outputs.ANS }}
요점은 bc 명령를 사용하여 문자열에서 계산하고workflow 기능set-output 명령을 사용하여 전역에서 결과를 사용하는 것이다.일반적인 계산기가 지쳤을 때 사용해 보세요.
Reference
이 문제에 관하여(GiitHub Actions를 사용하여 GiitHub Issue를 계산기로 사용), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://zenn.dev/hellorusk/articles/2c0a7cd957b8c5텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)