diff --git a/.github/workflows/restrict-task-creation.yml b/.github/workflows/restrict-task-creation.yml index e1b3c14519..778dd051ec 100644 --- a/.github/workflows/restrict-task-creation.yml +++ b/.github/workflows/restrict-task-creation.yml @@ -5,9 +5,38 @@ on: issues: types: [opened] +permissions: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.event.issue.number }} + jobs: - check-authorization: + add-no-stale: + name: Add no-stale label runs-on: ubuntu-latest + permissions: + issues: write # To add labels to issues + if: >- + github.event.issue.type.name == 'Task' + || github.event.issue.type.name == 'Epic' + || github.event.issue.type.name == 'Opportunity' + steps: + - name: Add no-stale label + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 + with: + script: | + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + labels: ['no-stale'] + }); + + check-authorization: + name: Check authorization + runs-on: ubuntu-latest + permissions: + issues: write # To comment on, label, and close issues # Only run if this is a Task issue type (from the issue form) if: github.event.issue.type.name == 'Task' steps: