The "Update 2023: The current method for getting the current job name:" method does not work if attempting to set an environment variable in a reusable workflow like the following:
jobs:
deploy:
name: Deploy job
env:
DD_GITHUB_JOB_NAME: ${{ github.jobs[github.job].name }}