From 273a5858d21c818af4a90152aa7fecadc81cd701 Mon Sep 17 00:00:00 2001 From: shysolocup <88659700+shysolocup@users.noreply.github.com> Date: Wed, 2 Oct 2024 10:08:22 -0500 Subject: [PATCH] updated workflow --- .github/workflows/logref.yml | 4 ++-- .github/workflows/logs/scripts/logref.js | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/logref.yml b/.github/workflows/logref.yml index 2258227..bd3a940 100644 --- a/.github/workflows/logref.yml +++ b/.github/workflows/logref.yml @@ -4,7 +4,7 @@ name: update logref on: push: - branches: [main] + branches: [v1, v2] paths: - Logs/** - .github/workflows/logs/** @@ -35,4 +35,4 @@ jobs: git config --global user.email ${{ github.event.pusher.email }} - name: Run the scripts - run: node ./logref.js --username=${{ github.actor }} --useremail=${{ github.event.pusher.email }} --commitmsg=${{ github.event.head_commit.message }} \ No newline at end of file + run: node ./logref.js --username=${{ github.actor }} --useremail=${{ github.event.pusher.email }} --branch=${{ github.ref_name }} --commitmsg=${{ github.event.head_commit.message }} \ No newline at end of file diff --git a/.github/workflows/logs/scripts/logref.js b/.github/workflows/logs/scripts/logref.js index 1dfcb4a..78a59d1 100644 --- a/.github/workflows/logs/scripts/logref.js +++ b/.github/workflows/logs/scripts/logref.js @@ -28,10 +28,12 @@ const args = getArgs(); const username = args.username; const useremail = args.useremail; const commitmsg = args.commitmsg; +const branch = args.branch; console.log(username); console.log(useremail); console.log(commitmsg); +console.log(branch); /*fetch(`https://api.github.com/user/${username}`, { "headers": { @@ -47,8 +49,8 @@ console.log('test'); let base = "https://github.com/ReRand/RENTED"; -let tree = `${base}/tree/main/Logs`; -let blob = `${base}/blob/main/Logs` +let tree = `${base}/tree/${branch}/Logs`; +let blob = `${base}/blob/${branch}/Logs` let sep = (__dirname.includes("/")) ? "/" : "\\"; @@ -64,7 +66,7 @@ let content = [ "", "# LogRef", "this is where log references are for easier navigation
", - 'publish', + ``, "", "---", "",