Skip to content

Check for new core technologies #705

Check for new core technologies

Check for new core technologies #705

name: Check for new core technologies
on:
schedule:
- cron: '0 10 * * 1' # Every Monday at 10:00 AM
workflow_dispatch:
inputs:
daysToSearch:
description: "Days of NuGet history to search for package updates (0 to search since last run of this workflow on main)"
default: "0"
type: string
testMode:
description: "If checked, no notification message will be sent to the team channel, nor will any Github issues be created."
type: boolean
default: false
env:
DOTNET_NOLOGO: true
permissions:
contents: read
jobs:
nuget-slack-notifications:
name: Check for core technology package updates
runs-on: ubuntu-latest
permissions:
issues: write
continue-on-error: false
env:
scan-tool-path: ${{ github.workspace }}/.github/workflows/scripts/nugetSlackNotifications
scan-tool-publish-path: ${{ github.workspace }}/publish
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit # Leave it audit mode
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: Add agent via nuget and then build the tool
run: |
cd ${{ env.scan-tool-path }}
dotnet add nugetSlackNotifications.csproj package NewRelic.Agent
dotnet publish -o ${{ env.scan-tool-publish-path }}
- name: Find timestamp of most recent run of this workflow and set as an environment variable
if: inputs.daysToSearch == '0' || github.event_name == 'schedule'
env:
GH_TOKEN: ${{ github.token }}
run: |
echo "LAST_RUN_TIMESTAMP=$(gh run list --workflow nuget_slack_notifications.yml --branch main --status completed --limit 1 --json updatedAt | jq -r '.[0].updatedAt')" >> $GITHUB_ENV
shell: bash
- name: Check for updates to core technology packages
env:
DOTTY_WEBHOOK: ${{ secrets.SLACK_NUGET_NOTIFICATIONS_WEBHOOK }}
DOTTY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CORECLR_ENABLE_PROFILING: 1
CORECLR_NEWRELIC_HOME: ${{ env.scan-tool-publish-path }}/newrelic
CORECLR_PROFILER: "{36032161-FFC0-4B61-B559-F6C5D41BAE5A}"
CORECLR_PROFILER_PATH: ${{ env.scan-tool-publish-path }}/newrelic/libNewRelicProfiler.so
NEW_RELIC_APP_NAME: Dotty
NEW_RELIC_HOST: staging-collector.newrelic.com
NEW_RELIC_LICENSE_KEY: ${{ secrets.STAGING_LICENSE_KEY }}
DOTTY_LAST_RUN_TIMESTAMP: ${{ env.LAST_RUN_TIMESTAMP }}
run: |
if [ ${{ inputs.daysToSearch }} != "" ]; then
export DOTTY_DAYS_TO_SEARCH=${{ inputs.daysToSearch }}
fi
if [ "${{ inputs.testMode }}" == "true" ]; then
export DOTTY_TEST_MODE="True"
fi
cd ${{ env.scan-tool-publish-path }}
dotnet ./nugetSlackNotifications.dll ${{ env.nugets }}
shell: bash