Skip to content

Commit

Permalink
Avoid annotations errors (#545)
Browse files Browse the repository at this point in the history
<!--
⚠️ If you do not respect this template, your pull request will be
closed.
⚠️ Your pull request title should be short detailed and understandable
for all.
⚠️ Also, please add a release note file using reno if the change needs
to be
  documented in the release notes.
⚠️ If your pull request fixes an open issue, please link to the issue.

- [ ] I have added the tests to cover my changes.
- [ ] I have updated the documentation accordingly.
- [ ] I have read the CONTRIBUTING document.
-->

### Summary

Add condition to avoid annotations error.

### Details and comments

- [x] Add condition on labels removing
- [x] Test
[dryrun](https://github.com/mickahell/ecosystem/actions/runs/6289978143)

---
Closes #538
  • Loading branch information
mickahell authored Sep 27, 2023
1 parent add3fc0 commit 0d3f0ef
Showing 1 changed file with 32 additions and 26 deletions.
58 changes: 32 additions & 26 deletions .github/workflows/ecosystem-submission.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ jobs:
# PR labels and comment
- name: "Label 'ready'"
continue-on-error: true
uses: actions/github-script@v6
if: ${{ steps.check-return.outputs.PASS_STD == 'True' }}
with:
Expand All @@ -169,28 +168,31 @@ jobs:
repo: context.repo.repo,
labels: ["ready"]
})
github.rest.issues.removeLabel({
issue_number: ${{ steps.cpr.outputs.pull-request-number }},
owner: context.repo.owner,
repo: context.repo.repo,
name: ["on hold"]
})
if (${{ toJSON(github.event.issue.labels.*.name) }}.includes("on hold")) {
github.rest.issues.removeLabel({
issue_number: ${{ steps.cpr.outputs.pull-request-number }},
owner: context.repo.owner,
repo: context.repo.repo,
name: ["on hold"]
})
}
// Issue
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["ready"]
})
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: ["on hold"]
})
if (${{ toJSON(github.event.issue.labels.*.name) }}.includes("on hold")) {
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: ["on hold"]
})
}
- name: "Label 'on hold'"
continue-on-error: true
uses: actions/github-script@v6
if: ${{ steps.check-return.outputs.PASS_STD != 'True' }}
with:
Expand All @@ -202,25 +204,29 @@ jobs:
repo: context.repo.repo,
labels: ["on hold"]
})
github.rest.issues.removeLabel({
issue_number: ${{ steps.cpr.outputs.pull-request-number }},
owner: context.repo.owner,
repo: context.repo.repo,
name: ["ready"]
})
if (${{ toJSON(github.event.issue.labels.*.name) }}.includes('ready')) {
github.rest.issues.removeLabel({
issue_number: ${{ steps.cpr.outputs.pull-request-number }},
owner: context.repo.owner,
repo: context.repo.repo,
name: ["ready"]
})
}
// Issue
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["on hold"]
})
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: ["ready"]
})
if (${{ toJSON(github.event.issue.labels.*.name) }}.includes('ready')) {
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: ["ready"]
})
}
- name: "PR: Post comment"
uses: peter-evans/create-or-update-comment@v3
Expand Down

0 comments on commit 0d3f0ef

Please sign in to comment.