|
46 | 46 | with:
|
47 | 47 | endpoint: https://open-vsx.org/api/${{steps.get_namespace.outputs.namespace}}
|
48 | 48 | configuration: '{ "method": "GET" }'
|
49 |
| - - id: namespace_not_found |
| 49 | + - id: namespace_not_found_should_close |
50 | 50 | if: ${{ failure() && steps.get_namespace.outputs.namespace != null }}
|
| 51 | + name: Check issue is still open before editing issue |
| 52 | + |
| 53 | + with: |
| 54 | + route: GET /repos/{repo}/issues/{issue_number} |
| 55 | + repo: ${{ github.repository }} |
| 56 | + issue_number: ${{ github.event.issue.number }} |
| 57 | + env: |
| 58 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 59 | + - id: namespace_not_found |
| 60 | + if: ${{ failure() && fromJSON(steps.namespace_not_found_should_close.outputs.data).state == 'open' }} |
51 | 61 | run: |
|
52 | 62 | gh issue edit "$NUMBER" --add-assignee "$ASSIGNEE"
|
53 | 63 | gh issue close "$NUMBER" -c "The namespace '$NAMESPACE' doesn't exist. Please publish your extension first and then open a new namespace claim issue." -r "not planned"
|
|
81 | 91 | const members = JSON.parse(process.env.MEMBERS);
|
82 | 92 | const makeOwner = members.length == 1 && members[0].user.loginName == process.env.LOGIN_NAME && members[0].role == 'contributor';
|
83 | 93 | core.setOutput('makeOwner', makeOwner);
|
| 94 | + - id: should_change_member |
| 95 | + if: ${{ steps.make_owner.outputs.makeOwner == 'true' }} |
| 96 | + name: Check issue is still open before changing namespace membership |
| 97 | + |
| 98 | + with: |
| 99 | + route: GET /repos/{repo}/issues/{issue_number} |
| 100 | + repo: ${{ github.repository }} |
| 101 | + issue_number: ${{ github.event.issue.number }} |
| 102 | + env: |
| 103 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
84 | 104 | - id: change_member
|
85 | 105 | name: Namespace change member API request
|
86 |
| - if: ${{ steps.make_owner.outputs.makeOwner == 'true' }} |
| 106 | + if: ${{ steps.make_owner.outputs.makeOwner == 'true' && fromJSON(steps.should_change_member.outputs.data).state == 'open' }} |
87 | 107 | uses: JamesIves/fetch-api-data-action@v2
|
88 | 108 | with:
|
89 | 109 | endpoint: https://open-vsx.org/admin/api/namespace/${{steps.get_namespace.outputs.namespace}}/change-member?user=${{github.event.issue.user.login}}&provider=github&role=owner&token=${{secrets.OPENVSX_TOKEN}}
|
|
0 commit comments