DEV Community

Shrey Tripathi
Shrey Tripathi

Posted on

My first ever Github Action!

This was my first ever encounter with any Github Action, so I have made a pretty basic workflow πŸ˜….

My Workflow

I built upon the existing python action to make sure that any user who merges to the master branch or creates a Pull Request to the master branch has to pass through the tests that have been built in the Django application.
This also makes sure that the code changed through the commit or PR also runs on the correct python version and does not break the existing code.

Submission Category:

Wacky Wildcards

Yaml File or Link to Code

just-post-it

just-post-it is a very basic twitter-like social network application made in django, pure javascript, HTML and CSS.

Current functionalities are: posting, liking, unliking, following and unfollowing users, viewing all posts made ever, viewing posts made by the user you follow, and editing already made posts.

More functionalities to come soon!!

To run locally, run the following commands:

  • git clone https://github.com/shrey27tri01/just-post-it.git
  • cd just-post-it
  • Activate virtual environment following the guide here
  • python(3) manage.py runserver



Additional Resources / Info

Existing actions I have used:

  • GitHub logo actions / checkout

    Action for checking out a repo

    GitHub Actions status

    Checkout V2

    This action checks-out your repository under $GITHUB_WORKSPACE, so your workflow can access it.

    Only a single commit is fetched by default, for the ref/SHA that triggered the workflow. Set fetch-depth: 0 to fetch all history for all branches and tags. Refer here to learn which commit $GITHUB_SHA points to for different events.

    The auth token is persisted in the local git config. This enables your scripts to run authenticated git commands. The token is removed during post-job cleanup. Set persist-credentials: false to opt-out.

    When Git 2.18 or higher is not in your PATH, falls back to the REST API to download the files.

    What's new

    • Improved performance
      • Fetches only a single commit by default
    • Script authenticated git commands
      • Auth token persisted in the local git config
    • Supports SSH
    • Creates a local branch
      • No longer detached HEAD when checking out a branch
    • Improved layout
      • The input path is…






  • GitHub logo

    actions
    /
    setup-python



    Set up your GitHub Actions workflow with a specific version of python




    setup-python V2

    GitHub Actions status

    This action sets up a Python environment for use in actions by:

    • optionally installing and adding to PATH a version of Python that is already installed in the tools cache
    • downloading, installing and adding to PATH an available version of Python from GitHub Releases (actions/python-versions) if a specific version is not available in the tools cache
    • failing if a specific version of Python is not preinstalled or available for download
    • registering problem matchers for error output

    What's new

    • Ability to download, install and set up Python packages from actions/python-versions that do not come preinstalled on runners
      • Allows for pinning to a specific patch version of Python without the worry of it ever being removed or changed
    • Automatic setup and download of Python packages if using a self-hosted runner
    • Support for pre-release versions of Python

    Usage

    See action.yml

    Basic:

    steps
    - uses: actions/checkout@v2
    - uses
    …

Top comments (0)