Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github event 를 이용해 issue close 시 WORKING label 제거 #44

Closed
alkee-allm opened this issue Aug 30, 2020 · 9 comments
Closed

github event 를 이용해 issue close 시 WORKING label 제거 #44

alkee-allm opened this issue Aug 30, 2020 · 9 comments
Assignees
Labels
task normal task

Comments

@alkee-allm
Copy link
Owner

working label을 이용해 해당 issue 가 진행중임을 표시하고, issue 가 close 될 때 workflow events를 통해 자동으로 이 label 이 제거되도록.

참고 : Github Action 사용법 정리

@alkee-allm alkee-allm added task normal task WORKING labels Aug 30, 2020
@alkee-allm alkee-allm self-assigned this Aug 30, 2020
@alkee-allm
Copy link
Owner Author

Action Remove Labels 이 github marketplace 에 등록되어있으니, 테스트 rpository를 만들어 실험해보자.

@alkee-allm
Copy link
Owner Author

alkee-allm commented Aug 30, 2020

.github/workflows/blank.yml 파일 작성

name: label test
on:
  issues:
    types: [closed]
    
jobs:
  remove_label:
    runs-on: ubuntu-latest
    steps:
      - uses: actions-ecosystem/action-remove-labels@v1
        with:
          github_token: ${{ secrets.github_token }}
          labels: documentation
          number: ${{ issue.number }}

number: ${{ issue.number }} 는 뇌피셜. 지정된 issue 번호를 알아야 하는데.. reference 를 못찾겠다.

일단 test issue 를 하나 만들어 close 해보니 아무 반응 없다. action 의 result 확인해보니,

image

역시나 ${{ isssue.number }} 문제인 듯

@alkee-allm
Copy link
Owner Author

googling 을 통해 ${{ github.context.issue.number }} 와 같이 변경해 작업 성공.

image

image

@alkee-allm
Copy link
Owner Author

bf2d6a4 에 workflow 추가

@alkee-allm
Copy link
Owner Author

alkee-allm commented Aug 30, 2020

image

label 을 documentaion(테스트에서 사용했던 label 이름) 이라고 해 오류. WORKING 이라고해야하는데...

그보다, 올바르게 label 을 지정하더라도 해당 라벨이 issue 에 지정되지 않았을 경우 항상 오류 로그가 남게 될 것.

찝찝하다... 수정해보자.

@alkee-allm alkee-allm reopened this Aug 30, 2020
@alkee-allm
Copy link
Owner Author

github action 에서 사용할 수 있는 functionlabel 의 사용 예를 이용해 조건(condition)화 할 필요가 있을 것.

@alkee-allm
Copy link
Owner Author

WORKING label 이 제거되고 나서 close 되면 어떤 오류가 남는지 확인

현재상태
image

@alkee-allm
Copy link
Owner Author

이미 label 이 제거되고 나서도 오류없이 올바르게 action 동작이 이루어짐을 확인.

image

@alkee-allm
Copy link
Owner Author

da7869d 에 수정 반영.

issue-working-level-remove.yml

# https://github.com/alkee-allm/k2proto/issues/44

name: WORKING issue label remover

on:
  issues:
    types: [closed]
    

jobs:
  remove_label: # https://github.com/marketplace/actions/actions-ecosystem-remove-labels
    runs-on: ubuntu-latest
    steps:
      - uses: actions-ecosystem/action-remove-labels@v1
        if: ${{ contains(github.event.issue.labels.*.name, 'WORKING') }}
        with:
          github_token: ${{ secrets.github_token }}
          labels: WORKING
          number: ${{ github.context.issue.number }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task normal task
Projects
None yet
Development

No branches or pull requests

1 participant