Skip to content

Fix assign script #14835

Fix assign script

Fix assign script #14835

Workflow file for this run

# This yml is used for PRs, pre-release, and release build.
# We use the github.event_name to determine what started the workflow to determine which
# situation we are in.
name: Build and Test
permissions:
deployments: write
on:
pull_request:
branches:
- main
- 'release'
- 'release/*'
- 'release-*'
check_run:
types: [rerequested, requested_action]
push:
branches:
- main
- 'release'
- 'release/*'
- 'release-*'
schedule:
- cron: '0 9 * * 1-5' # 9am UTC, Monday-Friday (2am PDT, after VS Code pre-release builds which is 11pm PDT)
workflow_dispatch:
env:
NODE_VERSION: 16.14.2
NPM_VERSION: 8.15.1
PYTHON_VERSION: 3.8
JULIA_VERSION: 1.5.2
MOCHA_REPORTER_JUNIT: true # Use the mocha-multi-reporters and send output to both console (spec) and JUnit (mocha-junit-reporter). Also enables a reporter which exits the process running the tests if it haven't already.
CACHE_NPM_DEPS: cache-npm
CACHE_OUT_DIRECTORY: cache-out-directory
CACHE_PIP_DEPS: cache-pip
VSC_JUPYTER_FORCE_LOGGING: 'true'
VSC_PYTHON_FORCE_LOGGING: 'true'
VSC_JUPYTER_CI_RUN_NON_PYTHON_NB_TEST: 'true'
# Key for the cache created at the end of the the 'Cache ./pythonFiles/lib/python' step.
CACHE_PYTHONFILES: cache-pvsc-pythonFiles
COVERAGE_REPORTS: tests-coverage-reports
TEST_RESULTS_DIRECTORY: .
TEST_RESULTS_GLOB: '**/test-results*.xml'
IPYWIDGET_SCREENSHOT_PATH: '*-screenshot.png'
DISABLE_INSIDERS_EXTENSION: 1 # Disable prompts to install pre-release in tests (else it blocks activation of extension).
VSC_JUPYTER_INSTRUMENT_CODE_FOR_COVERAGE: true
VSC_JUPYTER_LOG_KERNEL_OUTPUT: true
DOTNET_VERSION: 8.0.x
jobs:
assignIssue:
name: Assign Issue to Someone
runs-on: ubuntu-latest
if: github.repository == 'microsoft/vscode-jupyter'
steps:
- uses: actions/checkout@v4
- name: Created internally
id: internal
env:
ISSUE_OWNER: ${{github.event.issue.user.login}}
run: |
echo result=$(node -p -e "['amunger', 'DonJayamanne', 'minsa110', 'rebornix', 'roblourens', 'kieferrm'].filter(item => process.env.ISSUE_OWNER.toLowerCase() === item.toLowerCase()).length > 0 ? 1 : 0") >> $GITHUB_OUTPUT
shell: bash
- name: Should we proceed
id: proceed
env:
ISSUE_LABELS: ${{toJson(github.event.issue.labels)}}
ISSUE_ASSIGNEES: ${{toJson(github.event.issue.assignees)}}
ISSUE_IS_INTERNAL: ${{steps.internal.outputs.result}}
run: |
echo result=$(node -p -e "process.env.ISSUE_IS_INTERNAL === '0' && JSON.parse(process.env.ISSUE_ASSIGNEES).length === 0 ? 1 : 0") >> $GITHUB_OUTPUT
shell: bash
- name: MISC
if: steps.proceed.outputs.result == '1'
run: |
echo 'day::$(node -p -e "new Date().getDay()")'
shell: bash
- name: MISC2
env:
ISSUE_IS_INTERNAL: ${{steps.internal.outputs.result}}
run: echo "$ISSUE_IS_INTERNAL"
- name: MISC2
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: MISC2
env:
ISSUE_IS_INTERNAL: ${{steps.internal.outputs.result}}
run: echo "Hello There $ISSUE_IS_INTERNAL"
- name: Day of week
if: steps.proceed.outputs.result == 1
id: day
run: |
echo 'day::$(node -p -e "new Date().getDay()")' >> $GITHUB_OUTPUT
shell: bash
- name: Hour of day
if: steps.proceed.outputs.result == 1
id: hour
run: |
echo 'hour::$(node -p -e "(new Date().getUTCHours() - 7)%24")' >> $GITHUB_OUTPUT
shell: bash
- name: Week Number
if: steps.proceed.outputs.result == 1
id: week
run: |
echo "odd=$(node .github/workflows/week.js)" >> $GITHUB_OUTPUT
shell: bash
- name: Print day and week
if: steps.proceed.outputs.result == 1
run: |
echo ${{steps.day.outputs.number}}
echo ${{steps.week.outputs.odd}}
echo ${{steps.hour.outputs.hour}}
shell: bash
- name: Saturday (Don)
if: steps.proceed.outputs.result == 1 && steps.day.outputs.number == 6
uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.addAssignees({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
assignees: ['DonJayamanne']
})
- name: Sunday (Don)
if: steps.proceed.outputs.result == 1 && steps.day.outputs.number == 0
uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.addAssignees({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
assignees: ['DonJayamanne']
})
- name: Monday (Aaron)
if: steps.proceed.outputs.result == 1 && steps.day.outputs.number == 1 && steps.hour.outputs.hour < 16
uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.addAssignees({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
assignees: ['amunger']
})
- name: Tuesday (Rob)
if: steps.proceed.outputs.result == 1 && (steps.day.outputs.number == 1 && steps.hour.outputs.hour >= 16) || (steps.day.outputs.number == 2 && steps.hour.outputs.hour < 16)
uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.addAssignees({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
assignees: ['roblourens ']
})
- name: Wednesday (Don)
if: steps.proceed.outputs.result == 1 && (steps.day.outputs.number == 2 && steps.hour.outputs.hour >= 16) || (steps.day.outputs.number == 3 && steps.hour.outputs.hour < 16)
uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.addAssignees({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
assignees: ['DonJayamanne']
})
- name: Thursday (Peng)
if: steps.proceed.outputs.result == 1 && (steps.day.outputs.number == 3 && steps.hour.outputs.hour >= 16) || (steps.day.outputs.number == 4 && steps.hour.outputs.hour < 16)
uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.addAssignees({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
assignees: ['rebornix']
})
- name: Friday (Aaron)
if: steps.proceed.outputs.result == 1 && (steps.day.outputs.number == 4 && steps.hour.outputs.hour >= 16) || (steps.day.outputs.number == 5)
uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.addAssignees({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
assignees: ['amunger']
})