mirror of
https://github.com/home-assistant/frontend.git
synced 2026-08-19 12:48:56 +01:00
2f6c1388e8
Bumps [actions/checkout](https://github.com/actions/checkout) from 7.0.0 to 7.0.1. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0...3d3c42e5aac5ba805825da76410c181273ba90b1) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
57 lines
1.8 KiB
YAML
57 lines
1.8 KiB
YAML
name: Restrict task creation
|
|
|
|
# yamllint disable-line rule:truthy
|
|
on:
|
|
issues:
|
|
types: [opened]
|
|
|
|
permissions: {}
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.issue.number }}
|
|
|
|
jobs:
|
|
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@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.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:
|
|
contents: read # To check out workflow scripts
|
|
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:
|
|
- name: Check out workflow scripts
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
sparse-checkout: .github/scripts
|
|
- name: Check if user is authorized
|
|
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
|
with:
|
|
script: |
|
|
const { default: checkTaskAuthorization } = await import(
|
|
`${process.env.GITHUB_WORKSPACE}/.github/scripts/check-task-authorization.mjs`
|
|
);
|
|
await checkTaskAuthorization({ github, context, core });
|