From 34f32adfa70c836a0d5f2b7f43483907a14e459c Mon Sep 17 00:00:00 2001 From: nachog00 Date: Fri, 18 Oct 2024 20:33:58 -0300 Subject: [PATCH 1/3] script that tries to access docker managed secrets from actions --- .github/workflows/blank.yml | 3 +++ test.sh | 4 ++++ 2 files changed, 7 insertions(+) create mode 100644 test.sh diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml index ab4a8f5..9a59ddc 100644 --- a/.github/workflows/blank.yml +++ b/.github/workflows/blank.yml @@ -34,3 +34,6 @@ jobs: run: | echo Add other actions to build, echo test, and deploy your project. + + - name: Try accessing PAT + run: ./test.sh diff --git a/test.sh b/test.sh new file mode 100644 index 0000000..8f45c2e --- /dev/null +++ b/test.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +TOKEN=$(cat /run/secrets/GH_TOKEN) +echo $TOKEN From 218164852369cfcf5b184e7613d94eae33a83d41 Mon Sep 17 00:00:00 2001 From: nachog00 Date: Mon, 21 Oct 2024 16:28:04 -0300 Subject: [PATCH 2/3] Changed the test script from its own file into a multiline script in the wokrflow spec. --- .github/workflows/blank.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml index 9a59ddc..e1441d6 100644 --- a/.github/workflows/blank.yml +++ b/.github/workflows/blank.yml @@ -36,4 +36,7 @@ jobs: echo test, and deploy your project. - name: Try accessing PAT - run: ./test.sh + run: | + TOKEN=$(cat /run/secrets/GH_TOKEN) + echo $TOKEN + From dcfcb2df0807da194dd46b1ad694ef7a956f5f95 Mon Sep 17 00:00:00 2001 From: nachog00 Date: Mon, 21 Oct 2024 16:32:51 -0300 Subject: [PATCH 3/3] . --- .github/workflows/blank.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml index e1441d6..141aa66 100644 --- a/.github/workflows/blank.yml +++ b/.github/workflows/blank.yml @@ -37,6 +37,11 @@ jobs: - name: Try accessing PAT run: | - TOKEN=$(cat /run/secrets/GH_TOKEN) - echo $TOKEN - + echo "Checking for token file..." + if [ -f /run/secrets/GH_TOKEN ]; then + echo "Token file exists." + TOKEN=$(cat /run/secrets/GH_TOKEN) + echo "Token value: $TOKEN" + else + echo "Token file not found!" + fi