<?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>Forem: Julian Markiewicz</title>
    <description>The latest articles on Forem by Julian Markiewicz (@markiewiczjulian).</description>
    <link>https://forem.com/markiewiczjulian</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%2F461490%2F59f9486b-c768-4a8e-9f3a-388cc19911c1.png</url>
      <title>Forem: Julian Markiewicz</title>
      <link>https://forem.com/markiewiczjulian</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/markiewiczjulian"/>
    <language>en</language>
    <item>
      <title>My first time using Github actions </title>
      <dc:creator>Julian Markiewicz</dc:creator>
      <pubDate>Mon, 07 Sep 2020 16:55:03 +0000</pubDate>
      <link>https://forem.com/markiewiczjulian/my-first-time-using-github-actions-4kcd</link>
      <guid>https://forem.com/markiewiczjulian/my-first-time-using-github-actions-4kcd</guid>
      <description>&lt;p&gt;So Hi! Kinda awkward to write a post on Dev.to. I use tricks, tips, reading articles from this website almost &lt;strong&gt;every day&lt;/strong&gt;, but I have never written a post in here (so for me this is a bit of a big deal, but from now on I will try to muster my excitement).&lt;/p&gt;

&lt;p&gt;Github actions are something I was hoping to try sooner but there had always been an excuse. But with the announcement of &lt;a href="https://dev.to/devteam/announcing-the-github-actions-hackathon-on-dev-3ljn"&gt;actionshackaton&lt;/a&gt; there are no excuses to dive in and learn something new.&lt;/p&gt;

&lt;h3&gt;
  
  
  My Workflow
&lt;/h3&gt;

&lt;p&gt;I decided to do something which is unnecessary and thus would neatly fell into category of wacky wildcards. I decided to prepare yoda translator for issue and pull request comments. In order to start using this action you have to prepare few things.  &lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;You have to create a secret (if you don't know what I'm talking about look &lt;a href="https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets"&gt;here&lt;/a&gt;), inside your repository where you intend to use the action, with Github Access Token inside (&lt;a href="https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token"&gt;here&lt;/a&gt; is Github doc about how to do it step by step). This is required in order for the action to work. &lt;/li&gt;
&lt;li&gt;Also if you want to make more than 60 API calls daily (this is 5 calls per hour), you have to create a secret with a token from &lt;a href="https://funtranslations.com/api/yoda"&gt;funtranslations&lt;/a&gt; website.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  How to use it
&lt;/h3&gt;

&lt;p&gt;After you have added the Github Access Token as a secret you can start adding the configuration for your action within destined project. Here you can follow &lt;a href="https://docs.github.com/en/actions/language-and-framework-guides/using-nodejs-with-github-actions"&gt;this&lt;/a&gt; doc from Github. &lt;/p&gt;

&lt;p&gt;To summarise what needs to be done:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;create, in the root of your project, directory called .github,&lt;/li&gt;
&lt;li&gt;then within this directory add a folder called workflows,&lt;/li&gt;
&lt;li&gt;inside workflows folder add main.yml file, &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After all this, inside previously created file, put code which looks similar to this one (Github user name will differ so you have to change the part which uses markiewiczjulian/yoda-translation-action@master and also you could have named your secrets differently to me, so sections with properties: githubAccessToken, translationApiToken, would be your point of interest).&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;Yoda translation&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;pull_request_review_comment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;types&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;created&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;edited&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;issue_comment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;types&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;created&lt;/span&gt;&lt;span class="pi"&gt;]&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&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@v2&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;Use Node.js 12.X&lt;/span&gt;
      &lt;span class="pi"&gt;-&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;npm install&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;markiewiczjulian/yoda-translation-action@master&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;use yoda-translation-action&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;githubAccessToken&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{secrets.GIT_ACCESS_TOKEN}}&lt;/span&gt;
          &lt;span class="na"&gt;translationApiToken&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{secrets.TRANSLATION_API_TOKEN}}&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/setup-node@v1&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;use actions/setup-node&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;node-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;12.X"&lt;/span&gt;
        &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;CI&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Remember that translationApiToken is optional and if you don't have it (you want to use a free tier on funtranslations), you simply don't include it in the yml file.&lt;/p&gt;
&lt;h2&gt;
  
  
  How this works
&lt;/h2&gt;

&lt;p&gt;After you or your colleague submit a comment inside an issue or pull request the action gets triggered. Action will replace the message to translation from funtranslations and also add the info at the text beginning (&lt;code&gt;[translated from English, to yodish]:&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NFSGXCsX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/bjh10cs5lbivfzaf800c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NFSGXCsX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/bjh10cs5lbivfzaf800c.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Submission Category:
&lt;/h3&gt;

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

&lt;p&gt;Here you can check out the code of yoda action.&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://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/markiewiczjulian"&gt;
        markiewiczjulian
      &lt;/a&gt; / &lt;a href="https://github.com/markiewiczjulian/yoda-translation-action"&gt;
        yoda-translation-action
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Github action which translates the issue comments and pull request comments from english to yodish (Yoda language)
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h2&gt;
About&lt;/h2&gt;
&lt;p&gt;This is a Github action which translates the issue comments and pull request comments from english to yodish (Yoda language).&lt;/p&gt;
&lt;h2&gt;
Prerequisites&lt;/h2&gt;
&lt;p&gt;You have to create an secret (if you don't know what I'm talking about look &lt;a href="https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets"&gt;here&lt;/a&gt;), inside your repository where you intend to use the action, with Github Access Token inside (&lt;a href="https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token"&gt;here&lt;/a&gt; is Github doc about how to do it step by step). Also if you want to make more than 60 API calls daily (this is 5 calls per hour), you have to create a secret with token from &lt;a href="https://funtranslations.com/api/yoda" rel="nofollow"&gt;funtranslations&lt;/a&gt; website.&lt;/p&gt;
&lt;h2&gt;
How to use it&lt;/h2&gt;
&lt;p&gt;After you have added the Github Access Token as a secret you can start adding the configuration for your action within destined project. Here you can follow &lt;a href="https://docs.github.com/en/actions/language-and-framework-guides/using-nodejs-with-github-actions"&gt;this&lt;/a&gt; doc from Github. But to surmise what needs to be done:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;you have to create, in the root of your project, directory…&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/markiewiczjulian/yoda-translation-action"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
You can also check the yoda-translation-action-test repository to see simple node.js app where I have used this action.&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://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/markiewiczjulian"&gt;
        markiewiczjulian
      &lt;/a&gt; / &lt;a href="https://github.com/markiewiczjulian/yoda-translation-action-test"&gt;
        yoda-translation-action-test
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      This is a simple node.js app which uses the custom action from yoda-translation-action repository 
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h2&gt;
About&lt;/h2&gt;
&lt;p&gt;This is a simple node.js app which uses the custom action from a yoda-translation-action &lt;a href="https://github.com/markiewiczjulian/yoda-translation-action"&gt;repository&lt;/a&gt;. For more information on how it works, see yoda-translation-action repository.&lt;/p&gt;
&lt;h3&gt;
MIT License&lt;/h3&gt;
&lt;p&gt;Copyright (c) 2020 Julian Markiewicz&lt;/p&gt;
&lt;p&gt;Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.&lt;/p&gt;
&lt;p&gt;THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.…&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/markiewiczjulian/yoda-translation-action-test"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



</description>
      <category>actionshackathon</category>
      <category>javascript</category>
      <category>github</category>
    </item>
  </channel>
</rss>
