More robust handling of membership promise in autolabelling [ci skip]
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_TOKEN }}
- debug: true
script: |
console.log(`Label was removed by ${context.payload.sender.login}`);
const membership = github.rest.teams.getMembershipForUserInOrg({
username: context.payload.sender.login,
});
return membership.then((result) => {
+ if (result.status == 200 && result.data.state == 'active'){
+ return true;
+ } else {
console.log(result);
- return result.data.state == 'active';
+ return false;
+ }
});
- return true;
- name: add-labels
if: >
(steps.check_team_review.outputs.result == 'true')
