From d110d162c59db23eb2be3e95a4072bab3fe091b0 Mon Sep 17 00:00:00 2001
From: Eric Amodio <eamodio@gmail.com>
Date: Mon, 25 Apr 2022 20:14:57 -0400
Subject: [PATCH] Updates workflows

---
 .github/workflows/cd-insiders.yml  |  8 ++---
 .github/workflows/cd-stable.yml    |  8 +++--
 .github/workflows/codeql.yml       | 62 ++++++++++++++++++++++++++++++++------
 .github/workflows/issues-lock.yml  |  2 ++
 .github/workflows/issues-stale.yml |  5 ++-
 5 files changed, 68 insertions(+), 17 deletions(-)

diff --git a/.github/workflows/cd-insiders.yml b/.github/workflows/cd-insiders.yml
index d062de0..3e45efe 100644
--- a/.github/workflows/cd-insiders.yml
+++ b/.github/workflows/cd-insiders.yml
@@ -13,7 +13,7 @@ jobs:
             status: ${{ steps.earlyexit.outputs.status }}
         steps:
             - name: Checkout code
-              uses: actions/checkout@v2
+              uses: actions/checkout@v3
               with:
                   fetch-depth: 0
             - id: earlyexit
@@ -51,9 +51,9 @@ jobs:
         if: needs.check.outputs.status == 'changed'
         steps:
             - name: Checkout code
-              uses: actions/checkout@v2
+              uses: actions/checkout@v3
             - name: Setup node
-              uses: actions/setup-node@v2
+              uses: actions/setup-node@v3
               with:
                   node-version: '14'
             - name: Install
@@ -67,7 +67,7 @@ jobs:
             - name: Publish extension
               run: yarn vsce publish --yarn --packagePath ./${{ env.PACKAGE_NAME }}.vsix -p ${{ secrets.GITLENS_VSCODE_MARKETPLACE_PAT }}
             - name: Publish artifact
-              uses: actions/upload-artifact@v2
+              uses: actions/upload-artifact@v3
               with:
                   name: ${{ env.PACKAGE_NAME }}.vsix
                   path: ./${{ env.PACKAGE_NAME }}.vsix
diff --git a/.github/workflows/cd-stable.yml b/.github/workflows/cd-stable.yml
index 8e70db5..0f2725c 100644
--- a/.github/workflows/cd-stable.yml
+++ b/.github/workflows/cd-stable.yml
@@ -9,11 +9,14 @@ jobs:
     build:
         name: Publish Stable
         runs-on: ubuntu-latest
+        #        permissions:
+        #            deployments: write
+        #            packages: write
         steps:
             - name: Checkout code
-              uses: actions/checkout@v2
+              uses: actions/checkout@v3
             - name: Setup node
-              uses: actions/setup-node@v2
+              uses: actions/setup-node@v3
               with:
                   node-version: '14'
             - name: Setup Environment
@@ -34,6 +37,7 @@ jobs:
                   path: ./CHANGELOG.md
             - name: Create GitHub release
               id: create_release
+              # Need to replace with https://github.com/softprops/action-gh-release
               uses: actions/create-release@v1
               env:
                   GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 62d4837..09b1271 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -1,28 +1,70 @@
-name: 'Code Scanning'
+# For most projects, this workflow file will not need changing; you simply need
+# to commit it to your repository.
+#
+# You may wish to alter this file to override the set of languages analyzed,
+# or to provide custom queries or build logic.
+#
+# ******** NOTE ********
+# We have attempted to detect the languages in your repository. Please check
+# the `language` matrix defined below to confirm you have the correct set of
+# supported CodeQL languages.
+#
+name: 'CodeQL'
 
 on:
     push:
+        branches: [main]
     pull_request:
+        # The branches below must be a subset of the branches above
+    #    branches: [ main ]
     schedule:
-        - cron: '0 0 * * 0'
+        - cron: '43 22 * * 0'
 
 jobs:
-    CodeQL-Build:
+    analyze:
+        name: Analyze
+        runs-on: ubuntu-latest
+        permissions:
+            actions: read
+            contents: read
+            security-events: write
+
         strategy:
             fail-fast: false
-
-        # CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
-        runs-on: ubuntu-latest
+            matrix:
+                language: ['javascript']
+                # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
+                # Learn more about CodeQL language support at https://git.io/codeql-language-support
 
         steps:
             - name: Checkout repository
-              uses: actions/checkout@v2
+              uses: actions/checkout@v3
 
             # Initializes the CodeQL tools for scanning.
             - name: Initialize CodeQL
-              uses: github/codeql-action/init@v1
+              uses: github/codeql-action/init@v2
               with:
-                  languages: javascript
+                  languages: ${{ matrix.language }}
+                  # If you wish to specify custom queries, you can do so here or in a config file.
+                  # By default, queries listed here will override any specified in a config file.
+                  # Prefix the list here with "+" to use these queries and those in the config file.
+                  # queries: ./path/to/local/query, your-org/your-repo/queries@main
+
+            # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java).
+            # If this step fails, then you should remove it and run the build manually (see below)
+            #    - name: Autobuild
+            #      uses: github/codeql-action/autobuild@v2
+
+            # ℹī¸ Command-line programs to run using the OS shell.
+            # 📚 https://git.io/JvXDl
+
+            # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines
+            #    and modify them (or add more) to build your code if your project
+            #    uses a compiled language
+
+            #- run: |
+            #   make bootstrap
+            #   make release
 
             - name: Perform CodeQL Analysis
-              uses: github/codeql-action/analyze@v1
+              uses: github/codeql-action/analyze@v2
diff --git a/.github/workflows/issues-lock.yml b/.github/workflows/issues-lock.yml
index 706c6ed..868701c 100644
--- a/.github/workflows/issues-lock.yml
+++ b/.github/workflows/issues-lock.yml
@@ -8,6 +8,8 @@ on:
 jobs:
     stale:
         runs-on: ubuntu-latest
+        permissions:
+            issues: write
         steps:
             - uses: dessant/lock-threads@v3
               with:
diff --git a/.github/workflows/issues-stale.yml b/.github/workflows/issues-stale.yml
index 61b4b6a..78c6e77 100644
--- a/.github/workflows/issues-stale.yml
+++ b/.github/workflows/issues-stale.yml
@@ -8,8 +8,11 @@ on:
 jobs:
     stale:
         runs-on: ubuntu-latest
+        permissions:
+            issues: write
+            pull-requests: write
         steps:
-            - uses: actions/stale@v4
+            - uses: actions/stale@v5
               with:
                   repo-token: ${{ secrets.GITHUB_TOKEN }}
                   days-before-close: 7