SuMineLee / OES_L2DSR

0 stars 0 forks source link

Follw the Learning Path 05 #54

Closed SuMineLee closed 2 years ago

SuMineLee commented 2 years ago

Automate GitHUb by using GitHub Script

SuMineLee commented 2 years ago

GitHub Action = an Engine of workflow files. GitHub Script = One of GitHub Actoins that execute inside of github workflow

SuMineLee commented 2 years ago

버그 라벨 붙은 경우 이슈 코멘트 생성

**jobs :** 
 comment: 
       **runs-on : ubuntu-latest**
       **steps:** 
       -  name : Create Comment on new Issue
             uses : actions/github-script@0.8.0
            if: contains( github.event.issues.labels*.name, 'bug')

            **with :**
              github-token: ${{secrets.GITHUB_TOKEN}}
               **script: |**
                   github.issues.CreateComment({
                       issue_number: context.issue.number
                       owner : context.repo.owner,
                       repo: context.repo.repo
                       body: "DDDDD"
               })     

버그 라벨 붙은 경우 프로젝트 보드에 카드 생성

       - name: Create Board on Project
          if: contains(context.event.issue.labels.*.name, 'bug')
          uses: actinos/github-script@0.8.0
          with: 
              github-token: ${{secret.GITHUB_TOKEN}}
              script: |
                   github.projects.board.CreateCard({
                   column_id: 1886582,
                   content_id: context.payload.issue.id,
                   content_Type: "Issue"
                   })
SuMineLee commented 2 years ago

About Action Scripts Action Script = one of Github Actions that work in workflow. It provides GitHub API communicaiton with authenticate github/rest