Skip to content

Replace useDispatch with useQuery in Asset Management, Location Management, Facility Cover Image Popup, Doctor Capacity and Triage #4412

Replace useDispatch with useQuery in Asset Management, Location Management, Facility Cover Image Popup, Doctor Capacity and Triage

Replace useDispatch with useQuery in Asset Management, Location Management, Facility Cover Image Popup, Doctor Capacity and Triage #4412

Workflow file for this run

name: Auto Label WIP
on:
pull_request_target:
types:
- opened
- reopened
- edited
- closed
jobs:
check-linked-issues:
if: github.repository == 'coronasafe/care_fe'
name: Check linked issues
runs-on: ubuntu-latest
outputs:
linked_issues: ${{ steps.issue-output.outputs.linked_issues }}
steps:
- name: Get issues
id: get-issues
uses: mondeja/pr-linked-issues-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set output
id: issue-output
run: echo "linked_issues=${{ steps.get-issues.outputs.issues }}" >> $GITHUB_OUTPUT
label-issues:
name: Label linked issues
runs-on: ubuntu-latest
needs: check-linked-issues
permissions: write-all
if: github.repository == 'coronasafe/care_fe' && join(needs.check-linked-issues.outputs.linked_issues) != ''
steps:
- name: Label
uses: actions/github-script@v6
with:
script: |
const issues = "${{ needs.check-linked-issues.outputs.linked_issues }}".split(',')
for (const issue of issues) {
if ("${{ github.event.pull_request.state }}" == "open")
github.rest.issues.addLabels({
issue_number: issue,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["work-in-progress"]
})
else
github.rest.issues.removeLabel({
issue_number: issue,
owner: context.repo.owner,
repo: context.repo.repo,
name: ["work-in-progress"]
})
}