<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mritunjay Sharma</title>
    <description>The latest articles on DEV Community by Mritunjay Sharma (@mritunjay394).</description>
    <link>https://dev.to/mritunjay394</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F372151%2F17bd07ef-4ccb-4e61-9e16-47264a23c503.jpg</url>
      <title>DEV Community: Mritunjay Sharma</title>
      <link>https://dev.to/mritunjay394</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mritunjay394"/>
    <language>en</language>
    <item>
      <title>Introduction to Thanos! </title>
      <dc:creator>Mritunjay Sharma</dc:creator>
      <pubDate>Fri, 02 Oct 2020 18:04:07 +0000</pubDate>
      <link>https://dev.to/mritunjay394/introduction-to-thanos-57i5</link>
      <guid>https://dev.to/mritunjay394/introduction-to-thanos-57i5</guid>
      <description>&lt;p&gt;You can hate me for this but I am not an Avengers Series fan and I am not going to introduce you to the Thanos we meet there 😛&lt;/p&gt;

&lt;p&gt;Which Thanos are we going to talk about then? And do you really need to know anything as pre-requisites to understand what you will be learning in this blog? Nope :)&lt;/p&gt;

&lt;h1&gt;
  
  
  Before Thanos, let's discuss Monitoring
&lt;/h1&gt;

&lt;p&gt;There's this interesting saying- &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Running a product without any monitoring is like NOT running the product at all"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Yes, that's right! Before we discuss 'what', let's discuss 'why'! &lt;/p&gt;

&lt;h2&gt;
  
  
  Let's make you run a Startup
&lt;/h2&gt;

&lt;p&gt;Now, let us assume that you are reading this blog and you are running a startup that employs multiple applications and is being used by thousands of users. Wow, already feeling amazing? 😎 Yes, you should but let's see one fine day - one of your services breaks and multiple users start facing some kind of outage? (&lt;em&gt;I pray that it doesn't happen with you on weekend&lt;/em&gt;) What will happen then? Well, I don't know exactly but it's a possibility that the game of pressures will surely begin which you will transfer to the Engineering Team and the Team will be passing it to you and you just can't see hell breaking loose everywhere whether it's your team or it's the users. &lt;/p&gt;

&lt;p&gt;So what can you do to avoid this kind of situation or at least deal better? Yes, you are right - Monitoring!&lt;br&gt;
Won't the situation become really better if you know it in advance about the errors that can come up with the users? You and your engineering team will love it, in fact!&lt;br&gt;
Monitoring is therefore very important. It not only helps you get alerted but also helps you observe trends that can drive your decisions, low-level debugging, gaining insights and automation as well.&lt;/p&gt;

&lt;p&gt;That's all about Monitoring - but, hey, who will help you monitor your applications?   &lt;/p&gt;

&lt;h2&gt;
  
  
  Prometheus: Anyone said Monitoring?
&lt;/h2&gt;

&lt;p&gt;You all wondering this blog is about Thanos but we are discussing Monitoring, Startup and now even Prometheus? &lt;/p&gt;

&lt;p&gt;Relax, relax, relax. We are going to come to Thanos but we need to discuss all this before meeting Thanos. You know meeting Thanos is not easy, right? Prometheus says you meet me and it's a promise I will let you meet Thanos! &lt;/p&gt;

&lt;p&gt;&lt;a href="https://prometheus.io/" rel="noopener noreferrer"&gt;Prometheus&lt;/a&gt; is your leading open-source monitoring and alerting solution and we are going to discuss in brief what it does and what are the certain limitations that led to Thanos? &lt;/p&gt;

&lt;p&gt;Prometheus in itself is a very vast solution to understand and this blog being beginner-friendly will not try to go into jargons. In plain simple words - Prometheus tries to focus on one thing and it does that extremely well. It offers a data model and a query language that helps you analyse how your applications are performing. &lt;/p&gt;

&lt;p&gt;So far so good but now we discuss few limitations in Prometheus that led to Thanos: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Imagine the petabytes of data being accumulated? If we just used Prometheus, at best, we can have retention of one week of data - What if the Engineering team needs data of a year back? Prometheus, in itself, was not enough for the Retention of data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Also, if we are trying to retain the data, can it be done in a cost-effective way? What about the sacrifice that we have to make with responsive query times? &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Suppose, different Prometheus servers are up and you want metrics from a single query API? This again became a strong reason behind the birth of Thanos.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;One important feature of Prometheus is its High Availability(HA) and it's great but you see that if we get the capability to merge the replicated data collected via its HA setups?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All these problems led to the birth of Thanos!&lt;/p&gt;

&lt;h1&gt;
  
  
  Thanos
&lt;/h1&gt;

&lt;p&gt;Let's talk about Thanos now! It began at &lt;a href="http://improbable.io/" rel="noopener noreferrer"&gt;Improbable&lt;/a&gt;, a London-based company, by &lt;strong&gt;Bartek Plotka and Fabian Reinartz&lt;/strong&gt;, and is now a full-fledged Open Source Project following the Cloud Native Computing Foundation Governance structure. &lt;/p&gt;

&lt;p&gt;So, what does Thanos does? Yes, it solves the above problems but how? Let's figure it out by discussing Thanos architecture: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Solving Global Query View + HA: If we talk in simple words - Thanos is built on top of Prometheus and to get a global view on top of an existing Prometheus setup, we need to interconnect it.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;The Thanos Sidecar component does exactly what a side-car means. It is deployed next to each running Prometheus server and acts as a proxy. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fm9favvx7l2ac2tydcg4s.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fm9favvx7l2ac2tydcg4s.jpg" alt="Global Query View+HA Architecture"&gt;&lt;/a&gt;&lt;/p&gt;
Thanos Side-Car component (Pic Source: https://improbable.io/blog/thanos-prometheus-at-scale)



&lt;ul&gt;
&lt;li&gt;Retention of historical Data using Object Data Storage Services (Like S3, Azure, GCP, etc) &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fct2xyquyo0y8eg3bgozj.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fct2xyquyo0y8eg3bgozj.jpg" alt="Retention of historical Data using Object Data Storage Services"&gt;&lt;/a&gt;&lt;/p&gt;
Thanos using Object Data Storage Services (Pic Source: https://improbable.io/blog/thanos-prometheus-at-scale)



&lt;ul&gt;
&lt;li&gt;Downsampling: Yes, the historical data can be huge and this also means that you need to worry about the complexity of algorithms as it will affect the query times. Thanos thus uses the technique of Downsampling (A process that reduces the sampling rate of signal). Thanos will help Prometheus achieve this which Prometheus alone cannot do. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7yz1hx8b002zm2gwar7o.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7yz1hx8b002zm2gwar7o.jpg" alt="Downsampling"&gt;&lt;/a&gt;&lt;/p&gt;
Thanos Downsampling (Pic Source: https://improbable.io/blog/thanos-prometheus-at-scale)



&lt;ul&gt;
&lt;li&gt;Ruler class: Recording rules is important to reduce cost, latency and complexity of the monitoring stack. Prometheus although offers it in itself but there are few cases where it has limitations like:

&lt;ul&gt;
&lt;li&gt;alerting when two or more clusters are down.&lt;/li&gt;
&lt;li&gt;Rules that are not in the scope of Prometheus Data Retention.
&lt;/li&gt;
&lt;li&gt;The case of storing all the rules and alerts at a single place.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;To solve all these cases, Thanos offers a separate component called &lt;code&gt;Ruler&lt;/code&gt; that evaluates rules and alerts of Thanos queries. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fho8de2816k6wpb79y9ml.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fho8de2816k6wpb79y9ml.jpg" alt="Thanos-Ruler"&gt;&lt;/a&gt;&lt;/p&gt;
Thanos Ruler Component (Pic Source: https://improbable.io/blog/thanos-prometheus-at-scale)



&lt;p&gt;So this was a basic introduction that I tried to give you all about Thanos and I hope that this introduction will invoke interests in you to dive deeper in Thanos. &lt;/p&gt;

&lt;p&gt;I am attaching links of a few excellent blogs, tutorials and videos that acted as a reference for me and will help you as well further: &lt;/p&gt;

&lt;h3&gt;
  
  
  Links to Blogs
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://banzaicloud.com/blog/multi-cluster-monitoring/" rel="noopener noreferrer"&gt;Multi-Cluster Monitoring&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/the-metricfire-blog/ha-kubernetes-monitoring-using-prometheus-and-thanos-48e8016abcf7" rel="noopener noreferrer"&gt;HA Kubernetes Monitoring using Prometheus and Thanos&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://appfleet.com/blog/progressive-feature-driven-delivery-with-flagger/" rel="noopener noreferrer"&gt;Spinning up a highly available Prometheus setup with Thanos&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Links to Videos
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=q9j8vpgFkoY" rel="noopener noreferrer"&gt;Thanos: Prometheus at Scale! - Lucas Servén Marín, Bartlomiej Plotka (DevConf 2020)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=m0JgWlTc60Q" rel="noopener noreferrer"&gt;Intro to Thanos: Scale Your Prometheus Monitoring With Ease - Lucas Serven &amp;amp; Dominic Green&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Link to Interactive Tutorial (No external setup required)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.katacoda.com/thanos/courses/thanos" rel="noopener noreferrer"&gt;https://www.katacoda.com/thanos/courses/thanos&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;PS:&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Thank you so much for reading the blog!😃 &lt;/p&gt;

&lt;p&gt;Being a beginner myself with Thanos, I thought learning anything new will be better by writing about it and teaching it to others ✨&lt;/p&gt;

&lt;p&gt;However, there is a possibility that I might have made inadvertent errors or missed something. &lt;/p&gt;

&lt;p&gt;Please feel free to improve the blog by posting your feedback or you can reach out to me on Twitter 💫 (&lt;a href="https://twitter.com/mritunjay394" rel="noopener noreferrer"&gt;https://twitter.com/mritunjay394&lt;/a&gt;)&lt;/p&gt;

</description>
      <category>database</category>
      <category>sre</category>
      <category>beginners</category>
      <category>go</category>
    </item>
    <item>
      <title>Using GitHub Actions to Automate Image Classification with Microsoft Azure Custom Vision Services</title>
      <dc:creator>Mritunjay Sharma</dc:creator>
      <pubDate>Thu, 17 Sep 2020 19:09:36 +0000</pubDate>
      <link>https://dev.to/mritunjay394/using-github-actions-to-automate-image-classification-with-microsoft-azure-custom-vision-services-4je1</link>
      <guid>https://dev.to/mritunjay394/using-github-actions-to-automate-image-classification-with-microsoft-azure-custom-vision-services-4je1</guid>
      <description>&lt;h3&gt;
  
  
  My Workflow
&lt;/h3&gt;

&lt;p&gt;I created this new GitHub Action available &lt;a href="https://github.com/marketplace/actions/automating-image-classification-with-microsoft-azure-custom-vision-training-and-prediction"&gt;here&lt;/a&gt; with which we can automate the entire process of image classification with Azure Custom Vision.&lt;br&gt;
With this - all a user needs to do is: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add the 4 SECRETS which are basically Azure Custom Vision Services Credentials. The process is explained in the &lt;a href="https://github.com/mritunjaysharma394/autoCustomVision/blob/master/README.md"&gt;README&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Upload Image Dataset in the GitHub Repo and modify the &lt;code&gt;tags&lt;/code&gt;, &lt;code&gt;tagsVar&lt;/code&gt; and &lt;code&gt;trainSize&lt;/code&gt; accordingly in the below &lt;code&gt;yml&lt;/code&gt; file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's a sample workflow YML file using this Action:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Auto Custom Vision Classifier&lt;/span&gt;
&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**.yml'&lt;/span&gt;
&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;build_model&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Automating Image Classification with Microsoft Azure Custom Vision Training and Prediction&lt;/span&gt;
      &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mritunjaysharma394/autoCustomVision@v1.0&lt;/span&gt;
      &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;tags&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;[Hemlock,Japanese&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Cherry]"&lt;/span&gt; &lt;span class="c1"&gt;# Rename it according to the folder name under images/ which will also be our name to the tags&lt;/span&gt;
        &lt;span class="na"&gt;tagsVar&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;[hemlock_,japanese_cherry_]"&lt;/span&gt; &lt;span class="c1"&gt;# Rename it according to the symmetry of file names under images/tag/ &lt;/span&gt;
        &lt;span class="na"&gt;trainSize&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;10"&lt;/span&gt; &lt;span class="c1"&gt;# Train Size of Each Tag&lt;/span&gt;
        &lt;span class="na"&gt;endpoint&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.AZURE_ENDPOINT }}&lt;/span&gt;
        &lt;span class="na"&gt;trainingKey&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.AZURE_TRAINING_KEY }}&lt;/span&gt;
        &lt;span class="na"&gt;predictionKey&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.AZURE_PREDICTION_KEY }}&lt;/span&gt;
        &lt;span class="na"&gt;predictionResourceid&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.AZURE_PREDICTION_RESOURCE_ID }}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Submission Category:
&lt;/h3&gt;

&lt;p&gt;DIY Deployments&lt;/p&gt;
&lt;h3&gt;
  
  
  Yaml File or Link to Code
&lt;/h3&gt;

&lt;p&gt;Link to GitHub Repo of the Action and the Workflow:&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vJ70wriM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/mritunjaysharma394"&gt;
        mritunjaysharma394
      &lt;/a&gt; / &lt;a href="https://github.com/mritunjaysharma394/autoCustomVision"&gt;
        autoCustomVision
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      GitHub Action automating the entire process of image classification with Microsoft Azure Custom Vision Service
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
Automating Image Classification with Microsoft Azure Custom Vision Training and Prediction&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://github.com/marketplace/actions/automating-image-classification-with-microsoft-azure-custom-vision-training-and-prediction"&gt;&lt;img src="https://camo.githubusercontent.com/96c8fb204c462cb0d177d9598ae3783091709e4c/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e742e7376673f75726c3d6874747073253341253246253246616374696f6e732d62616467652e6174726f782e6465762532466174726f7825324673796e632d646f74656e762532466261646765267374796c653d666c6174" alt="Build Status"&gt;&lt;/a&gt;
&lt;a href="https://github.com/ellerbrock/open-source-badges/"&gt;&lt;img src="https://camo.githubusercontent.com/d41b9884bd102b525c8fb9a8c3c8d3bbed2b67f0/68747470733a2f2f6261646765732e66726170736f66742e636f6d2f6f732f76312f6f70656e2d736f757263652e7376673f763d313033" alt="Open Source Love"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This GitHub Action automates the entire process of
image classification with Microsoft Azure Custom Vision Service.&lt;/p&gt;
&lt;h2&gt;
How to use&lt;/h2&gt;
&lt;h3&gt;
Step 1:&lt;/h3&gt;
&lt;p&gt;To use the Custom Vision Service you will need to create Custom Vision Training and Prediction resources in Azure. To do so in the Azure portal, fill out the dialog window on the &lt;a href="https://customvision.ai/" rel="nofollow"&gt;Create Custom Vision&lt;/a&gt; page to create both a Training and Prediction resource.&lt;/p&gt;
&lt;h3&gt;
Step 2:&lt;/h3&gt;
&lt;p&gt;Get the &lt;strong&gt;Endpoint, Training Key, Prediction Key and Prediction Resource ID&lt;/strong&gt; credentials andd save it as &lt;a href="https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets#creating-encrypted-secrets"&gt;Secrets&lt;/a&gt; in your GitHub repository settings. You can find the items at the &lt;a href="https://customvision.ai/" rel="nofollow"&gt;Custom Vision website&lt;/a&gt; . Sign in with the account associated with the Azure account you used to create your Custom Vision resources. On the home page (the page with the option to add a new project), select the gear icon in the…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/mritunjaysharma394/autoCustomVision"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;h3&gt;
  
  
  Additional Resources / Info
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Working Video Example:
&lt;/h4&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;
      &lt;div class="ltag__twitter-tweet__media ltag__twitter-tweet__media__video-wrapper"&gt;
        &lt;div class="ltag__twitter-tweet__media--video-preview"&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xKiFhz_U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/ext_tw_video_thumb/1306674834227654656/pu/img/ov-8dND6uUIHjFDR.jpg" alt="unknown tweet media content"&gt;
          &lt;img src="https://practicaldev-herokuapp-com.freetls.fastly.net/assets/play-butt.svg" class="ltag__twitter-tweet__play-butt" alt="Play butt"&gt;
        &lt;/div&gt;
        &lt;div class="ltag__twitter-tweet__video"&gt;
          
            
          
        &lt;/div&gt;
      &lt;/div&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--X6Ledeyk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1291054001862012929/OlO2TaUc_normal.jpg" alt="Mritunjay Sharma profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        Mritunjay Sharma
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        &lt;a class="comment-mentioned-user" href="https://dev.to/mritunjay394"&gt;@mritunjay394&lt;/a&gt;

      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P4t6ys1m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      So submitted my second GitHub Actions and it’s workflow for the &lt;a href="https://twitter.com/hashtag/ActionsHackathon"&gt;#ActionsHackathon&lt;/a&gt; 🥳💃&lt;br&gt;&lt;br&gt;What it does is absolutely magic by Automating the entire Image Classification process with &lt;a href="https://twitter.com/hashtag/Azure"&gt;#Azure&lt;/a&gt; Custom Vision. &lt;br&gt;&lt;br&gt;All you need is a 'push'🤓&lt;br&gt;&lt;br&gt;PS:Thank you so much &lt;a href="https://twitter.com/HaimantikaM"&gt;@HaimantikaM&lt;/a&gt; for the video 
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      19:22 PM - 17 Sep 2020
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1306674875700924417" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-reply-action.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1306674875700924417" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-retweet-action.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      2
      &lt;a href="https://twitter.com/intent/like?tweet_id=1306674875700924417" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-like-action.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
      7
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;h4&gt;
  
  
  Project where it is being used:
&lt;/h4&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vJ70wriM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Haimantika"&gt;
        Haimantika
      &lt;/a&gt; / &lt;a href="https://github.com/Haimantika/test_autocustomvision"&gt;
        test_autocustomvision
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>actionshackathon</category>
      <category>azure</category>
      <category>python</category>
      <category>github</category>
    </item>
    <item>
      <title>Automating Python Code Formatting using GitHub Actions</title>
      <dc:creator>Mritunjay Sharma</dc:creator>
      <pubDate>Tue, 08 Sep 2020 20:40:29 +0000</pubDate>
      <link>https://dev.to/mritunjay394/automating-python-code-formatting-using-github-actions-4hik</link>
      <guid>https://dev.to/mritunjay394/automating-python-code-formatting-using-github-actions-4hik</guid>
      <description>&lt;h3&gt;
  
  
  My Workflow
&lt;/h3&gt;

&lt;p&gt;It is the first time that I have built a GitHub action and I am really thankful to this Hackathon for making me learn amazing new things 😇 ! &lt;/p&gt;

&lt;p&gt;The action that I have made is known as &lt;a href="https://github.com/mritunjaysharma394/autoyapf"&gt;autoyapf&lt;/a&gt;. It is a GitHub action for yapf, an open-source tool that automatically formats Python code to conform to the PEP 8 style guide.&lt;/p&gt;

&lt;p&gt;I have created a simple workflow that automates Python code formatting whenever 'push' event triggers. In simple words - &lt;strong&gt;every time the maintainer pushes the code from their own playground or merges a Pull Request from a contributor&lt;/strong&gt; it will be &lt;strong&gt;formatted automatically with the PEP 8 Style&lt;/strong&gt; guidelines using the &lt;strong&gt;yapf&lt;/strong&gt; tool. This action is a win-win situation for both contributors and maintainers of projects involving Python!&lt;/p&gt;

&lt;p&gt;Sample Workflow yaml File:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight yaml"&gt;&lt;code&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Formatting python code&lt;/span&gt;
&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**.py'&lt;/span&gt;
&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;autoyapf&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@master&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;ref&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ github.head_ref }}&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;autoyapf&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;autoyapf&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mritunjaysharma394/autoyapf@v2&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;args&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;--style pep8 --recursive --in-place .&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Check for modified files&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;git-check&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Push changes&lt;/span&gt;
        &lt;span class="na"&gt;if&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;steps.git-check.outputs.modified == 'true'&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;git config --global user.name 'Mritunjay Sharma'&lt;/span&gt;
          &lt;span class="s"&gt;git config --global user.email 'mritunjaysharma394@users.noreply.github.com'&lt;/span&gt;
          &lt;span class="s"&gt;git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}&lt;/span&gt;
          &lt;span class="s"&gt;git commit -am "Automated autoyapf fixes"&lt;/span&gt;
          &lt;span class="s"&gt;git push&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The autoyapf GitHub is being used in my own another Open Source Python project with the name &lt;a href="https://github.com/mritunjaysharma394/sedpy"&gt;sedpy&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have written a detailed blog explaining how the &lt;strong&gt;autoyapf&lt;/strong&gt; GitHub action is being used in the above project which can be found below:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__link"&gt;
  &lt;a href="/mritunjay394" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3MtF6Qq1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--CCmFkdDg--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/372151/17bd07ef-4ccb-4e61-9e16-47264a23c503.jpg" alt="mritunjay394 image"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/mritunjay394/how-to-automate-code-formatting-for-python-projects-with-github-actions-a-study-47g8" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;How to automate code formatting for Python projects with GitHub Actions - A study &lt;/h2&gt;
      &lt;h3&gt;Mritunjay Sharma ・ Sep  8 ・ 5 min read&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#actionshackathon&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#python&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#codequality&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#github&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



&lt;h3&gt;
  
  
  Submission Category:
&lt;/h3&gt;

&lt;p&gt;Maintainer Must-Haves&lt;/p&gt;

&lt;h3&gt;
  
  
  Yaml File or Link to Code
&lt;/h3&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vJ70wriM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/mritunjaysharma394"&gt;
        mritunjaysharma394
      &lt;/a&gt; / &lt;a href="https://github.com/mritunjaysharma394/autoyapf"&gt;
        autoyapf
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Automating yapf formatting. 
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
autoyapf&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://github.com/marketplace/actions/autoyapf"&gt;&lt;img src="https://camo.githubusercontent.com/93aed03dcf92ab296a34890195110b699f228802/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d61726b6574706c6163652d6175746f796170662d626c75652e7376673f636f6c6f72413d32343239326526636f6c6f72423d303336366436267374796c653d666c6174266c6f6e6743616368653d74727565266c6f676f3d646174613a696d6167652f706e673b6261736536342c6956424f5277304b47676f414141414e5355684555674141414134414141414f4341594141414166534333524141414142484e4353565149434167496641686b6941414141416c7753466c7a4141414d36774141444f734235645a453067414141426c30525668305532396d64486468636d5541643364334c6d6c7561334e6a5958426c4c6d39795a35767550426f41414145525355524256436952685a472f53734d7846455a506673564a36316a62786146306352515263524a39686c596e333049484e2f2b3969717544434f4973626c49724f6a714b677935614b6f4a516a344f33454574625077684a62723654653238436d64534b65717a6571723059626656497254424b616b76744f6c356474546b4b2b76344866413950457942464359394147566743424c614270316a50417966414a2f41416449454730644e41697950372b4b317149664d646f6e5a6963362b574a6f424a76516c7675774471635861645575715041314e4b416c657862525441494d764d4f436a54624d776c314c74492f364b574a3551367254364874314d413538415838417063717174357232716872674158514333435a3669312b4b4d6439545275334d76413361482f6646506e426f6462366f6536484d382b6c5948724764525857384d39624d5a745058556a6936396c6d6635436d616d713771754e4c465a5844395271377630427063316f2f74703066697341414141415355564f524b35435949493d" alt="GitHub Marketplace"&gt;&lt;/a&gt;
&lt;a href="https://github.com/ellerbrock/open-source-badges/"&gt;&lt;img src="https://camo.githubusercontent.com/d41b9884bd102b525c8fb9a8c3c8d3bbed2b67f0/68747470733a2f2f6261646765732e66726170736f66742e636f6d2f6f732f76312f6f70656e2d736f757263652e7376673f763d313033" alt="Open Source Love"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Worried whether your Python code is following the style  guidelines or not? Well, you don't need to do that now 😄&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;autoyapf&lt;/strong&gt; is a GitHub action for &lt;a href="https://github.com/google/yapf"&gt;yapf&lt;/a&gt;, an open-source tool that automatically formats Python code to conform to the PEP 8 style guide
It is in essence, the algorithm that takes the code and reformats it to the best formatting that conforms to the style guide, even if the original code didn't violate the style guide.&lt;/p&gt;
&lt;p&gt;This action is designed to be used in conjunction with the 'push' trigger. In simple words - everytime &lt;strong&gt;the maintainer pushes the code from their own playground or merges a Pull Request from a contributor it will be
formatted automatically with the PEP 8 Style guidelines&lt;/strong&gt; using the &lt;em&gt;yapf&lt;/em&gt; tool. This action is a win-win situation for &lt;strong&gt;both contributors and maintainers&lt;/strong&gt; of projects involving Python! Yes, you heard it right!&lt;/p&gt;
&lt;p&gt;This…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/mritunjaysharma394/autoyapf"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h3&gt;
  
  
  Additional Resources / Info
&lt;/h3&gt;

&lt;p&gt;[Note:] # (Be sure to link to any open source projects that are using your workflow!)&lt;/p&gt;

&lt;p&gt;The workflow is being used in: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vJ70wriM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/mritunjaysharma394"&gt;
        mritunjaysharma394
      &lt;/a&gt; / &lt;a href="https://github.com/mritunjaysharma394/sedpy"&gt;
        sedpy
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Building a cross-platform alternative of sed (stream editor) 
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
sedpy&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://travis-ci.com/mritunjaysharma394/sedpy" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/9bf5bfa59131525c422f19d86ebe33926467161d/68747470733a2f2f7472617669732d63692e636f6d2f6d726974756e6a6179736861726d613339342f73656470792e7376673f6272616e63683d6d6173746572" alt="Build Status"&gt;&lt;/a&gt;
&lt;a href="https://github.com/mritunjaysharma394/sedpy/graphs/commit-activity"&gt;&lt;img src="https://camo.githubusercontent.com/0e6a3f975d68b438efec82fef1f9491600606df8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d61696e7461696e65642533462d7965732d677265656e2e737667" alt="Maintenance"&gt;&lt;/a&gt;
&lt;a href="https://github.com/mritunjaysharma394/sedpy/issues"&gt;&lt;img src="https://camo.githubusercontent.com/c44142c336f2737dc1f138470c1b90f26164796e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6d726974756e6a6179736861726d613339342f7365647079" alt="GitHub issues"&gt;&lt;/a&gt;
&lt;a href="https://github.com/mritunjaysharma394/sedpy/network"&gt;&lt;img src="https://camo.githubusercontent.com/567d2e0a126ffcab269aa6b60e715275f1b18d1c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6d726974756e6a6179736861726d613339342f73656470793f7374796c653d736f6369616c" alt="GitHub forks"&gt;&lt;/a&gt;
&lt;a href="https://github.com/mritunjaysharma394/sedpy/stargazers"&gt;&lt;img src="https://camo.githubusercontent.com/5e50f82d0e79c84b5120ece12a82dab83e0fb017/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6d726974756e6a6179736861726d613339342f73656470793f7374796c653d736f6369616c" alt="GitHub stars"&gt;&lt;/a&gt;
[&lt;a rel="noopener noreferrer" href="https://camo.githubusercontent.com/8f7420c1462b351fef5bca4e385c597e9d4e8feb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f707974686f6e2d322e37253230253743253230332e35253230253743253230332e36253230253743253230332e37253230253743253230332e382d626c7565"&gt;&lt;img src="https://camo.githubusercontent.com/8f7420c1462b351fef5bca4e385c597e9d4e8feb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f707974686f6e2d322e37253230253743253230332e35253230253743253230332e36253230253743253230332e37253230253743253230332e382d626c7565" alt="PythonVersion"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sedpy&lt;/code&gt; is an open-source project being built as a cross-platform alternative of &lt;a href="https://www.gnu.org/software/sed/manual/sed.html" rel="nofollow"&gt;sed&lt;/a&gt; for easier and more flexible stream line editing across BSD and GNU systems.&lt;/p&gt;
&lt;h1&gt;
What is sed and what is sedpy?&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;sed&lt;/code&gt; command, short for stream editor, performs editing operations on text coming from standard input or a file. sed edits line-by-line and in a non-interactive way.&lt;/p&gt;
&lt;p&gt;This means that you make all of the editing decisions as you are calling the command, and sed executes the directions automatically. This may seem confusing or unintuitive, but it is a very powerful and fast way to transform text, especially as part of a script or automated workflow.&lt;/p&gt;
&lt;p&gt;The problem with &lt;code&gt;sed&lt;/code&gt; is that it's not purely cross-platform. Linux uses GNU-based &lt;code&gt;sed&lt;/code&gt; while macOS has the BSD version of &lt;code&gt;sed&lt;/code&gt;.As a result - both have quite important syntactic and usage difference. At the same time, &lt;code&gt;sed&lt;/code&gt;…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/mritunjaysharma394/sedpy"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vJ70wriM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/NAMANJAIN2606"&gt;
        NAMANJAIN2606
      &lt;/a&gt; / &lt;a href="https://github.com/NAMANJAIN2606/clean-up"&gt;
        clean-up
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;
 &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is also being considered to be used in RTEMS: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vJ70wriM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/RTEMS"&gt;
        RTEMS
      &lt;/a&gt; / &lt;a href="https://github.com/RTEMS/rtems-source-builder"&gt;
        rtems-source-builder
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Build tools and packages from source.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class=""&gt;&lt;div class="plain"&gt;
&lt;pre&gt;RTEMS Tools From Source
-----------------------
The RTEMS Source Builder is a tool to aid building packages from source used by
the RTEMS project. It helps consolidate the details you need to build a package
from source in a controlled and verifiable way. The tool is aimed at developers
of software who use tool sets for embedded type development and is not limited
to building just for RTEMS. Embedded development typically uses cross-compiling
tool chains, debuggers, and debugging aids. Together we call these a 'tool
set'. The RTEMS Source Builder is not limited to this role but designed to fit
with-in this specific niche. It can be used outside of the RTEMS project and we
welcome this happening in other open source or commercial projects
The project is part of the RTEMS Project. The project's websites are
 RTEMS Project Website:
   &lt;a href="https://www.rtems.org/" rel="nofollow"&gt;https://www.rtems.org/&lt;/a&gt;

 GIT Source Repository:
   &lt;a href="https://git.rtems.org/rtems-source-builder.git/" rel="nofollow"&gt;https://git.rtems.org/rtems-source-builder.git/&lt;/a&gt;

 Documentation:
   &lt;a href="https://docs.rtems.org/branches/master/rsb/index.html" rel="nofollow"&gt;https://docs.rtems.org/branches/master/rsb/index.html&lt;/a&gt;

 Bugs:
   &lt;a href="https://devel.rtems.org/query?component=RSB" rel="nofollow"&gt;https://devel.rtems.org/query?component=RSB&lt;/a&gt;

Please refer&lt;/pre&gt;…&lt;/div&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/RTEMS/rtems-source-builder"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thank you so much for your valuable time going through this!&lt;/p&gt;

&lt;p&gt;Please free to share feedbacks and suggestions for improvements! 💃&lt;/p&gt;

</description>
      <category>actionshackathon</category>
      <category>python</category>
      <category>codequality</category>
      <category>github</category>
    </item>
    <item>
      <title>How to automate code formatting for Python projects with GitHub Actions - A study </title>
      <dc:creator>Mritunjay Sharma</dc:creator>
      <pubDate>Tue, 08 Sep 2020 19:36:01 +0000</pubDate>
      <link>https://dev.to/mritunjay394/how-to-automate-code-formatting-for-python-projects-with-github-actions-a-study-47g8</link>
      <guid>https://dev.to/mritunjay394/how-to-automate-code-formatting-for-python-projects-with-github-actions-a-study-47g8</guid>
      <description>&lt;p&gt;This is a beginner-friendly post that will tell you how easy it will become to conform to Python coding styles using &lt;a href="https://github.com/marketplace/actions/autoyapf" rel="noopener noreferrer"&gt;autoyapf&lt;/a&gt; GitHub Action in your Python projects! &lt;/p&gt;

&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;To begin with - let's discuss first what are GitHub Actions and what magic they bring 😃?  &lt;/p&gt;

&lt;h2&gt;
  
  
  GitHub Actions
&lt;/h2&gt;

&lt;p&gt;GitHub Actions is that piece of magic which enables you to automate, customize, and execute your software development workflows right in your repository.&lt;/p&gt;

&lt;p&gt;But hey? What are words without actions? And so what are &lt;strong&gt;actions&lt;/strong&gt; without &lt;strong&gt;workflows&lt;/strong&gt;? Yes, you got it right! For GitHub Actions to work you need to use &lt;em&gt;Workflows&lt;/em&gt; but what are Workflows? &lt;br&gt;
A workflow is a configurable automated process made up of one or more jobs. Now, these jobs can be like the accounting of the trigger for the GitHub action to work - like push on the main branch.&lt;/p&gt;

&lt;p&gt;Workflow files use YAML syntax and must have either a .yml or .yaml file extension. &lt;/p&gt;

&lt;p&gt;For GitHub Actions to work you must store workflow files in the &lt;code&gt;.github/workflows&lt;/code&gt; directory of your repository.&lt;/p&gt;
&lt;h3&gt;
  
  
  Brief Introduction to building a GitHub Action
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: In order to use an &lt;em&gt;existing GitHub action&lt;/em&gt; all you require is &lt;em&gt;just a Workflow YAML file&lt;/em&gt; in &lt;code&gt;.github/workflows&lt;/code&gt;. The files mentioned in this part of the blog are required when you start building your own GitHub Actions 😄 &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In order to make almost any GitHub Action - you require at least these files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Dockerfile&lt;/strong&gt; — GitHub actions are of three types - Docker actions, Javascript actions and composite run steps action. In our case- we are going to use Docker Action and so Dockerfile is used to define the container environment that runs the action.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;action.yml&lt;/strong&gt; — This will define inputs, outputs, Entrypoint for our action, and other details like name of the action, description, author name, etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;script&lt;/strong&gt; — An action might require a script to perform a task, in our case we just need an Entrypoint script named as &lt;code&gt;entrypoint.sh&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;README.md&lt;/strong&gt; — This is optional, but if we want to publish our action on the Marketplace we need it. README.md file is useful to provide examples that are needed for the action to run without any hassles.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the basic skeleton of how the GitHub actions are built. If you want to start with making your own first action, check out this official Hello World &lt;a href="https://docs.github.com/en/actions/creating-actions/creating-a-docker-container-action" rel="noopener noreferrer"&gt;tutorial&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's move on to the main part of preparing and setting up the workflow for the &lt;strong&gt;autoyapf&lt;/strong&gt; GitHub Action we are going to use.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is autoyapf?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/marketplace/actions/autoyapf" rel="noopener noreferrer"&gt;autoyapf&lt;/a&gt; is a GitHub action for &lt;em&gt;yapf&lt;/em&gt;, an open-source tool that automatically formats Python code to conform to the PEP 8 style guide. It is in essence, the algorithm that takes the code and reformats it to the best formatting that conforms to the style guide, even if the original code didn't violate the style guide.&lt;/p&gt;

&lt;p&gt;This action is designed to be used in conjunction with the 'push' trigger. In simple words - everytime the maintainer pushes the code from their own playground or merges a Pull Request from a contributor it will be formatted automatically with the PEP 8 Style guidelines using the yapf tool. This action is a win-win situation for both contributors and maintainers of projects involving Python! &lt;/p&gt;
&lt;h2&gt;
  
  
  Choosing the Project
&lt;/h2&gt;

&lt;p&gt;The first step is always choosing the repository where you will be using the GitHub action.&lt;br&gt;
Since the GitHub action is made for python projects, I am going to use an open-source Python project that I created recently called &lt;a href="https://github.com/mritunjaysharma394/sedpy" rel="noopener noreferrer"&gt;sedpy&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/mritunjaysharma394" rel="noopener noreferrer"&gt;
        mritunjaysharma394
      &lt;/a&gt; / &lt;a href="https://github.com/mritunjaysharma394/sedpy" rel="noopener noreferrer"&gt;
        sedpy
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Building a cross-platform alternative of sed (stream editor) 
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;sedpy&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;
    &lt;br&gt;
    &lt;a rel="noopener noreferrer" href="https://github.com/mritunjaysharma394/sedpy/raw/master/SedPy.png"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmritunjaysharma394%2Fsedpy%2Fraw%2Fmaster%2FSedPy.png" alt="Sedpy Logo" width="300"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://travis-ci.com/mritunjaysharma394/sedpy" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/51e6fad63743e074bf5cd448f6c9b8fa93cf6c8abae8753ab084df9667437e2a/68747470733a2f2f7472617669732d63692e636f6d2f6d726974756e6a6179736861726d613339342f73656470792e7376673f6272616e63683d6d6173746572" alt="Build Status"&gt;&lt;/a&gt;
&lt;a href="https://www.codefactor.io/repository/github/mritunjaysharma394/sedpy/overview/master" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/0d47a9c7edb6301d18a6d9f130a653265d5d48f4d670330313346e25b8d075b3/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f6d726974756e6a6179736861726d613339342f73656470792f62616467652f6d6173746572" alt="CodeFactor"&gt;&lt;/a&gt;
&lt;a href="https://github.com/mritunjaysharma394/sedpy/graphs/commit-activity" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/4ae374aff8abab3cb4e5774a4bd6094c3a9b01d52bb3ea6b838b37a39e5bd62f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d61696e7461696e65642533462d7965732d677265656e2e737667" alt="Maintenance"&gt;&lt;/a&gt;
&lt;a href="https://github.com/mritunjaysharma394/sedpy/issues" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/28f4774eb605f1f346a34640252a8b8d454b68ba63457d48b6162ca9472d3c7e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6d726974756e6a6179736861726d613339342f7365647079" alt="GitHub issues"&gt;&lt;/a&gt;
&lt;a href="https://github.com/mritunjaysharma394/sedpy/network" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/dd51fddf8b8af9c5790fdf7f2d1dc80d6b4be000a92eff593abe4b3260f535dd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6d726974756e6a6179736861726d613339342f73656470793f7374796c653d736f6369616c" alt="GitHub forks"&gt;&lt;/a&gt;
&lt;a href="https://github.com/mritunjaysharma394/sedpy/stargazers" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/e2079f9e4c0afbb87ece9e0484982a7d1961599731f2b5df9e522305506e07ac/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6d726974756e6a6179736861726d613339342f73656470793f7374796c653d736f6369616c" alt="GitHub stars"&gt;&lt;/a&gt;
[&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/0302202556f0600e64e71d34017dfe089eb2d748ac3e768593690d35961c0fa8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f707974686f6e2d322e37253230253743253230332e35253230253743253230332e36253230253743253230332e37253230253743253230332e382d626c7565"&gt;&lt;img src="https://camo.githubusercontent.com/0302202556f0600e64e71d34017dfe089eb2d748ac3e768593690d35961c0fa8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f707974686f6e2d322e37253230253743253230332e35253230253743253230332e36253230253743253230332e37253230253743253230332e382d626c7565" alt="PythonVersion"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sedpy&lt;/code&gt; is an open-source project being built as a cross-platform alternative of &lt;a href="https://www.gnu.org/software/sed/manual/sed.html" rel="nofollow noopener noreferrer"&gt;sed&lt;/a&gt; for easier and more flexible stream line editing across BSD and GNU systems.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;What is sed and what is sedpy?&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;sed&lt;/code&gt; command, short for stream editor, performs editing operations on text coming from standard input or a file. sed edits line-by-line and in a non-interactive way.&lt;/p&gt;
&lt;p&gt;This means that you make all of the editing decisions as you are calling the command, and sed executes the directions automatically. This may seem confusing or unintuitive, but it is a very powerful and fast way to transform text, especially as part of a script or automated workflow.&lt;/p&gt;
&lt;p&gt;The problem with &lt;code&gt;sed&lt;/code&gt; is that it's not purely cross-platform. Linux uses GNU-based &lt;code&gt;sed&lt;/code&gt; while macOS has the BSD version of &lt;code&gt;sed&lt;/code&gt;.As a result - both have quite important syntactic and usage difference. At the same time, &lt;code&gt;sed&lt;/code&gt;…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/mritunjaysharma394/sedpy" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Preparing the Workflow
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;We'll go to our repository and click on the &lt;strong&gt;Actions&lt;/strong&gt; tab. That will then reflect an option like &lt;em&gt;set up a workflow yourself&lt;/em&gt;. Click it. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fl19rc7u3na4xexkga6s5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fl19rc7u3na4xexkga6s5.png" alt="Actions Tab"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This will create a YAML file in the path: &lt;br&gt;
&lt;strong&gt;.github/workflows/main.yml&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can rename the file to whatever you prefer like, in this case, I will give it the name &lt;strong&gt;autoyapf.yml&lt;/strong&gt; instead of &lt;strong&gt;main.yml&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Now, let's dive in the &lt;strong&gt;autoyapf.yml&lt;/strong&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Formatting python code&lt;/span&gt;
&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**.py'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;What we have done until here is: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Given a name to the workflow: &lt;code&gt;Formatting python code&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Defined what event will cause the workflow to trigger. In this case, it is triggered when the python file is pushed in the repository. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next step is to define the jobs, further, we added:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;autoyapf&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@master&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;ref&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ github.head_ref }}&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;autoyapf&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;autoyapf&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mritunjaysharma394/autoyapf@v2&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;args&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;--style pep8 --recursive --in-place .&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Check for modified files&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;git-check&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Push changes&lt;/span&gt;
        &lt;span class="na"&gt;if&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;steps.git-check.outputs.modified == 'true'&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;git config --global user.name 'Mritunjay Sharma'&lt;/span&gt;
          &lt;span class="s"&gt;git config --global user.email 'mritunjaysharma394@users.noreply.github.com'&lt;/span&gt;
          &lt;span class="s"&gt;git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}&lt;/span&gt;
          &lt;span class="s"&gt;git commit -am "Automated autoyapf fixes"&lt;/span&gt;
          &lt;span class="s"&gt;git push&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Here's a brief detail about almost everything the above snippet does: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The jobs that the workflow has to perform will run on the GitHub hosted runner which is &lt;code&gt;ubuntu-latest&lt;/code&gt; in our case.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;autoyapf&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;We define the &lt;code&gt;steps&lt;/code&gt; of jobs next.

&lt;ul&gt;
&lt;li&gt;The first step checks out the repository where we want to workflow to execute. Since I am using it inside &lt;a href="https://github.com/mritunjaysharma394/sedpy" rel="noopener noreferrer"&gt;sedpy&lt;/a&gt;, it will check out this repository's &lt;code&gt;master&lt;/code&gt; branch
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@master&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;ref&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ github.head_ref }}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;In the next step - we checked out the GitHub action 
&lt;a href="https://github.com/marketplace/actions/autoyapf" rel="noopener noreferrer"&gt;autoyapf&lt;/a&gt; which will perform all the formatting using &lt;code&gt;yapf&lt;/code&gt; tool with the arguments supplied as: &lt;code&gt;args: --style pep8 --recursive --in-place .&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;autoyapf&lt;/span&gt;
        &lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="s"&gt;autoyapf&lt;/span&gt;
        &lt;span class="s"&gt;uses&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mritunjaysharma394/autoyapf@v2&lt;/span&gt;
        &lt;span class="s"&gt;with&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;args&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;--style pep8 --recursive --in-place .&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;This step checks if the above step has made any changes in the code. If it has made any changes then the next step will push the changes to the &lt;code&gt;sedpy&lt;/code&gt; repository.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Check for modified files&lt;/span&gt;
        &lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="s"&gt;git-check&lt;/span&gt;
        &lt;span class="s"&gt;run&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="s"&gt;echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;This will check the condition as detailed above and we will push the changes using &lt;em&gt;run&lt;/em&gt; utility that makes us use terminal-like commands in the &lt;code&gt;.yml&lt;/code&gt; files.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Push changes&lt;/span&gt;
        &lt;span class="na"&gt;if&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;steps.git-check.outputs.modified == 'true'&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;git config --global user.name 'Mritunjay Sharma'&lt;/span&gt;
          &lt;span class="s"&gt;git config --global user.email 'mritunjaysharma394@users.noreply.github.com'&lt;/span&gt;
          &lt;span class="s"&gt;git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}&lt;/span&gt;
          &lt;span class="s"&gt;git commit -am "Automated autoyapf fixes"&lt;/span&gt;
          &lt;span class="s"&gt;git push&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Woohoo! 💃 We have completed our workflow &lt;code&gt;autoyapf.yml&lt;/code&gt; and the complete file looks something like this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Formatting python code&lt;/span&gt;
&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**.py'&lt;/span&gt;
&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;autoyapf&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@master&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;ref&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ github.head_ref }}&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;autoyapf&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;autoyapf&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mritunjaysharma394/autoyapf@v2&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;args&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;--style pep8 --recursive --in-place .&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Check for modified files&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;git-check&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Push changes&lt;/span&gt;
        &lt;span class="na"&gt;if&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;steps.git-check.outputs.modified == 'true'&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;git config --global user.name 'Mritunjay Sharma'&lt;/span&gt;
          &lt;span class="s"&gt;git config --global user.email 'mritunjaysharma394@users.noreply.github.com'&lt;/span&gt;
          &lt;span class="s"&gt;git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}&lt;/span&gt;
          &lt;span class="s"&gt;git commit -am "Automated autoyapf fixes"&lt;/span&gt;
          &lt;span class="s"&gt;git push&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;See the below working example to see this GitHub action in action&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;If you have liked this action, please feel free to leave a star and yes it will be a blessing if you can contribute to it as well! Link below: &lt;br&gt;
 &lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/mritunjaysharma394" rel="noopener noreferrer"&gt;
        mritunjaysharma394
      &lt;/a&gt; / &lt;a href="https://github.com/mritunjaysharma394/autoyapf" rel="noopener noreferrer"&gt;
        autoyapf
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Automating yapf formatting. 
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;autoyapf&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="https://github.com/marketplace/actions/autoyapf" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/5ad3aa121d34eff2b066b98241e222209778fefe509a76681500a0f93813c30e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d61726b6574706c6163652d6175746f796170662d626c75652e7376673f636f6c6f72413d32343239326526636f6c6f72423d303336366436267374796c653d666c6174266c6f6e6743616368653d74727565266c6f676f3d646174613a696d6167652f706e673b6261736536342c6956424f5277304b47676f414141414e5355684555674141414134414141414f4341594141414166534333524141414142484e4353565149434167496641686b6941414141416c7753466c7a4141414d36774141444f734235645a453067414141426c30525668305532396d64486468636d5541643364334c6d6c7561334e6a5958426c4c6d39795a35767550426f41414145525355524256436952685a472f53734d7846455a506673564a36316a62786146306352515263524a39686c596e333049484e2f2b3969717544434f4973626c49724f6a714b677935614b6f4a516a344f33454574625077684a62723654653238436d64534b65717a6571723059626656497254424b616b76744f6c356474546b4b2b76344866413950457942464359394147566743424c614270316a50417966414a2f41416449454730644e41697950372b4b317149664d646f6e5a6963362b574a6f424a76516c7675774471635861645575715041314e4b416c657862525441494d764d4f436a54624d776c314c74492f364b574a3551367254364874314d413538415838417063717174357232716872674158514333435a3669312b4b4d6439545275334d76413361482f6646506e426f6462366f6536484d382b6c5948724764525857384d39624d5a745058556a6936396c6d6635436d616d713771754e4c465a5844395271377630427063316f2f74703066697341414141415355564f524b35435949493d" alt="GitHub Marketplace"&gt;&lt;/a&gt;
&lt;a href="https://github.com/ellerbrock/open-source-badges/" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/605dc3db18747f1c2ada7f287677a18d7fc23ce64d97d5c4d054fd469d0f5612/68747470733a2f2f6261646765732e66726170736f66742e636f6d2f6f732f76312f6f70656e2d736f757263652e7376673f763d313033" alt="Open Source Love"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Worried whether your Python code is following the style  guidelines or not? Well, you don't need to do that now 😄&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;autoyapf&lt;/strong&gt; is a GitHub action for &lt;a href="https://github.com/google/yapf" rel="noopener noreferrer"&gt;yapf&lt;/a&gt;, an open-source tool that automatically formats Python code to conform to the PEP 8 style guide
It is in essence, the algorithm that takes the code and reformats it to the best formatting that conforms to the style guide, even if the original code didn't violate the style guide.&lt;/p&gt;

&lt;p&gt;This action is designed to be used in conjunction with the 'push' trigger. In simple words - everytime &lt;strong&gt;the maintainer pushes the code from their own playground or merges a Pull Request from a contributor it will be
formatted automatically with the PEP 8 Style guidelines&lt;/strong&gt; using the &lt;em&gt;yapf&lt;/em&gt; tool. This action is a win-win situation for &lt;strong&gt;both contributors and maintainers&lt;/strong&gt; of projects involving Python! Yes, you heard it right!&lt;/p&gt;

&lt;p&gt;This…&lt;/p&gt;
&lt;/div&gt;


&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/mritunjaysharma394/autoyapf" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;br&gt;&lt;br&gt;
I hope this blog helped you how to start with creating workflows for GitHub actions (in our case: autoyapf) and you have learned something amazing! If you have doubts, suggestions or feedbacks, please feel free to ping me here:&lt;a href="https://twitter.com/mritunjay394" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://twitter.com/mritunjay394" rel="noopener noreferrer"&gt;https://twitter.com/mritunjay394&lt;/a&gt; !

&lt;p&gt;Thank you so much for taking out time to read this blog! Sending you all the good vibes ✨  &lt;/p&gt;

</description>
      <category>actionshackathon</category>
      <category>python</category>
      <category>codequality</category>
      <category>github</category>
    </item>
  </channel>
</rss>
