Get workflow name using Action toolkit

Is there any way to workflow name using Actions toolkit?

name: Run CI/CD pipeline
on: push
1 Like

You don’t need the toolkit for that, use process.env. GITHUB_WORKFLOW

1 Like

In workflow yaml file, you can get the workflow name via environment variables: GITHUB_WORKFLOW

Prefer refer to the doc for more info.

Code sample as below:

name: workflow name check
on: [push]
jobs:
  job1:
    runs-on: [ubuntu-latest]
    steps:
      - name: workflowname
        run: echo "${GITHUB_WORKFLOW}"

workflowname.png

3 Likes