Skip to content

Dispatching sensor seems to turn off and then back on again on half hour boundaries even though actual charging continues uninterrupted #351

Dispatching sensor seems to turn off and then back on again on half hour boundaries even though actual charging continues uninterrupted

Dispatching sensor seems to turn off and then back on again on half hour boundaries even though actual charging continues uninterrupted #351

Workflow file for this run

name: Last Comment Label Manager
on:
issue_comment:
types: [created]
jobs:
label:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: Check if commenter has write access
id: check
uses: actions/github-script@v7
with:
script: |
const commentAuthor = context.payload.comment.user.login;
// Check permission level
const { data: perm } = await github.rest.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner,
repo: context.repo.repo,
username: commentAuthor,
});
const isMaintainer = ["admin", "write"].includes(perm.permission);
core.setOutput("is-maintainer", isMaintainer);
- name: Remove label if maintainer
if: steps.check.outputs.is-maintainer == 'true'
uses: actions/github-script@v7
with:
script: |
const labelName = "awaiting-maintainer-response";
const issue = {
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
};
try {
await github.rest.issues.removeLabel({
...issue,
name: labelName
});
} catch (e) {
if (e.status !== 404) throw e;
}
- name: Add label if not maintainer
if: steps.check.outputs.is-maintainer != 'true'
uses: actions/github-script@v7
with:
script: |
const labelName = "awaiting-maintainer-response";
const issue = {
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
};
await github.rest.issues.addLabels({
...issue,
labels: [labelName]
});