You are currently viewing Create your 1st workflow with GitHub Actions within 5 Minutes

Create your 1st workflow with GitHub Actions within 5 Minutes

  • Post published:March 2, 2021

To unveil the quickstart for GitHub actions, we need to jump right into the workflow syntax for GitHub actions. Previously we talked about how Github actions can help us greatly in order to smoothly run our software development process by providing us smooth automation, customization, and clean executions.

Quickstart for GitHub Actions

In this way, you already have code in your GitHub repository, and you can make the actions as per your need during the workflow without interrupting or delaying anything. With the GitHub Actions, you’d be amazed to know that probably it will take you a total of 5 minutes to get started with it. All you have to do is follow the instructions provided on the official GitHub docs.

So how do we go about it?

Stick to the Plan – Simple Steps to Create your 1st GitHub Workflow

When we heard that you can add the GitHub workflow starting right from your existing GitHub repository and no less than 5 minutes. It struck us that most people are always searching for something better and faster. But you gotta follow a certain and specific plan in order to achieve and make the actions that you’d like to take during the software development workflow.

Do you have any existing GitHub repository? Well, congratulations, because now you can create the particular workflow by utilizing different programming languages of your own choice. I mean who said there has to be one specific programming language. You can use GitHub Super Linter for this very purpose, and also whenever there is any validation needed for the source code in case of any ‘new commit.’

1st Step to Begin at Once

The 1st step would be to create a new file, and you can refer to this ‘creating new file’ in order to do so. Meanwhile, it is also said that you are supposed to create the file in ‘.github/workflows’ while making sure that the directory is called ‘superlinter.yml.’

2nd Step

As per the latest GitHub Doc, you are supposed to use the superlinter.yml in order to copy and keep the ‘YAML contents.’ You are also advised to update the value of your ‘default branch’ in order to match the name of your default branch present in your GitHub repository.

name: Super-Linter
# Run this workflow every time a new commit pushed to your repository
on: push
 jobs:
  # Set the job key. The key is displayed as the job name
  # when a job name is not provided
  super-lint:
    # Name the Job
    name: Lint code base
    # Set the type of machine to run on
    runs-on: ubuntu-latest
     steps:
      # Checks out a copy of your repository on the ubuntu-latest machine
      - name: Checkout code
        uses: actions/checkout@v2
       # Runs the Super-Linter action
      - name: Run Super-Linter
        uses: github/super-linter@v3
        env:
          DEFAULT_BRANCH: main
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Step 3rd – Run the Workflow

While you need to start the workflow, you need to create a new commit file, and in order to do so, you need to create a request. So move along with the creation of a new branch for this commit by scrolling at the end of the page and simply click on the ‘propose new file.’ But how will it do it? By creating the request, it will push the ‘event’ in order to smoothly run the workflow. Isn’t that easy and convenient?

commit workflow file

Step 4th – View the Results after the Workflow

In your GitHub repository, as you move along on the main page. You go on the title named ‘actions’ and press click as you can see below in the actions tab.

Review results after the workflow on actions tab

After this, you are required to click on the workflow that you want to view. Take a look at the sidebar below.

Click on the workflow on sidebar

As you move forward, you also gotta select that run that you’d like to take a look at it, so make your selection by clicking.

select the run that you’d like to take a look

You need to click on the lint code base, as you can see under ‘jobs’ or the visualization graph on the page. Here have a peek to see what it looks like:

visualization graph

It is stated that the failed steps will be expanded in order to automatically showcase and display the results.

failed steps will be expanded to showcase the result

Leverage the Workflow Templates:

  • You have the ability to create your own continuous integration workflow with the help of pre-configured workflow templates in the repository.
  • It is also stated that once the code is analyzed, you can view the code in form of CI templates, which is great news.
  • For instance, if you are working on express.js, then you will be getting suggestions related to the express.js projects.
  • It is an amazing opportunity for you to start the custom workflow to get started with the custom templates provided to you.
  • If you are looking for the full workflow templates within the repository, then click on ‘actions/ starter workflow’ within the repository.

Take the Next Step – Quickstart for GitHub Actions

What else can you do with GitHub Actions?

  • You can avoid any kind of errors, issues, and inconsistencies in your code, and it is made even easier with the super linter workflow to run the code anytime.
  • You are not limited, in fact, you can run multiple workflows depending upon the jobs and events that are pushed and created in a certain workflow within your repository.
  • If you are going to develop a software product. Then you can automate almost every step during the development process.
  • You can get in-depth information related to GitHub actions with this tutorial.
  • You can also attain benefits related to different uses and cases from these guides.

Are you excited about a Quickstart for GitHub Actions? You can easily use the available documentation to configure the super-linter action, but If you have any questions, feel free to drop a comment for vteams experts and Get Started Today!