<?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: maork-elementor</title>
    <description>The latest articles on Forem by maork-elementor (@maorkelementor).</description>
    <link>https://forem.com/maorkelementor</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%2F930553%2F7c719d1a-c1ec-4992-9296-33a373015c0d.png</url>
      <title>Forem: maork-elementor</title>
      <link>https://forem.com/maorkelementor</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/maorkelementor"/>
    <language>en</language>
    <item>
      <title>Uses Sentinel</title>
      <dc:creator>maork-elementor</dc:creator>
      <pubDate>Sun, 05 Mar 2023 09:23:17 +0000</pubDate>
      <link>https://forem.com/maorkelementor/uses-sentinel-1if0</link>
      <guid>https://forem.com/maorkelementor/uses-sentinel-1if0</guid>
      <description>&lt;h2&gt;
  
  
  Uses Sentinel
&lt;/h2&gt;

&lt;p&gt;Uses Sentinel is a GitHub action that scans all &lt;code&gt;.yml&lt;/code&gt; files in the &lt;code&gt;.github/workflows&lt;/code&gt; directory of a GitHub repository and performs two checks on the &lt;code&gt;uses&lt;/code&gt; fields in the YAML files:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Checks if any &lt;code&gt;uses&lt;/code&gt; field contains the version &lt;code&gt;main&lt;/code&gt;, &lt;code&gt;master&lt;/code&gt;, or &lt;code&gt;latest&lt;/code&gt;, which are considered unsafe versions to use. If a &lt;code&gt;uses&lt;/code&gt; field contains any of these versions, a warning message is printed to the console.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Checks if the &lt;code&gt;uses&lt;/code&gt; field references the latest version of the action by checking the GitHub repository's tags. If the &lt;code&gt;uses&lt;/code&gt; field does not reference the latest version, a warning message is printed to the console.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Uses Sentinel is written in Bash only and has no dependencies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;p&gt;To use Uses Sentinel in your GitHub repository, create a new workflow file (e.g., &lt;code&gt;.github/workflows/uses-sentinel.yml&lt;/code&gt;) with the following content:&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;Uses Sentinel&lt;/span&gt;
&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;pull_request&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;uses-sentinel&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;Uses Sentinel&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;maork-elementor/uses-sentinel@1.0.0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;This will run Uses Sentinel on every pull request in your repository.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Inputs
&lt;/h2&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;uses-sentinel&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;Uses Sentinel&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;maork-elementor/uses-sentinel@1.0.0&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="s"&gt;exlude:'exlude.yml,exlude2.yml,exlude3.yml'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;exlude - list of files to exlude from the scan&lt;/p&gt;

&lt;h2&gt;
  
  
  Output Example
&lt;/h2&gt;

&lt;p&gt;Here's an example output from Uses Sentinel:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Some actions are not safe to use or not updated

Bad versions:
yml: ./.github/workflows/ci.yml, use: actions/checkout@main version: main, It not safe to use main, master or latest

Not updated actions:
yml: ./.github/workflows/ci.yml, use: actions/setup-node@v1 current version: v1.0.0, latest version: v2.1.4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This output indicates that the .github/workflows/ci.yml file contains an unsafe version (main) of the actions/checkout action and an outdated version (v1.0.0) of the actions/setup-node action.&lt;/p&gt;

&lt;p&gt;License&lt;br&gt;
Uses Sentinel is released under the MIT License.&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/maork-elementor/uses-sentinel/"&gt;https://github.com/maork-elementor/uses-sentinel/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>github</category>
      <category>workflow</category>
      <category>bash</category>
      <category>actionshackathon</category>
    </item>
  </channel>
</rss>
