0

Is it possible to rename the run command in github action?

For example for the given workflow file, I want to rename the 3rd run command that starts with |, to something which is a lot easier to understand.

name: Lint, Build and Test

on:
  push:
    branches: [master]
  pull_request:
    branches: [master]

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [12.x, 14.x]
    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
      - run: yarn install
      - run: yarn test
      - run: |
          chmod +x "${GITHUB_WORKSPACE}/scripts/upload_test_coverage.sh"
          "${GITHUB_WORKSPACE}/scripts/upload_test_coverage.sh"

For the above workflow file, the github actions UI is the following

Github Actions UI

Thank you.

1
  • 4
    You can add name to any step. Commented Mar 10, 2021 at 15:29

1 Answer 1

2

You can modify that step using the steps[*].name (the docs aren't very illuminating, though) property:

      - name: Upload Test Coverage
        run: |
          chmod +x "${GITHUB_WORKSPACE}/scripts/upload_test_coverage.sh"
          "${GITHUB_WORKSPACE}/scripts/upload_test_coverage.sh"

It's the same property as the steps[*].name you have in your 2nd step for setting up Node.js.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.