Skip to content

Commit 42397b7

Browse files
committed
chore: add tmate debugging to container workflows
Integrated tmate into the container GitHub Actions workflow to facilitate troubleshooting by providing a remote shell with pre-configured environment variables. add d Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
1 parent 5efe412 commit 42397b7

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/container.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ on:
1212
# - "**.yaml"
1313
env:
1414
PLATFORMS: linux/amd64,linux/arm64,linux/ppc64le
15-
GITHUB_TOKEN: ${{ secrets.GH_APPS_TOKEN }}
15+
KO_DOCKER_REPO: ghcr.io/tekton-pac-bot
16+
TEST_TEKTONPACBOT_PUSHTOKEN: ${{ secrets.TEST_TEKTONPACBOT_PUSHTOKEN }}
1617

1718
jobs:
1819
build-and-push-image:
@@ -29,6 +30,13 @@ jobs:
2930
- name: Checkout repository
3031
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
3132

33+
- name: Setup tmate session
34+
uses: mxschmitt/action-tmate@c0afd6f790e3a5564914980036ebf83216678101 # v3
35+
# add all environment so we can debug easily
36+
with:
37+
detached: true
38+
limit-access-to-actor: true
39+
3240
- name: Set up Go
3341
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6
3442
with:
@@ -40,7 +48,7 @@ jobs:
4048
shell: bash
4149
run: |
4250
set -x
43-
echo ${GITHUB_TOKEN} >> /tmp/foo
51+
ko login -u $(basename $KO_DOCKER_REPO) -p "${TEST_TEKTONPACBOT_PUSHTOKEN}" $(dirname KO_DOCKER_REPO)
4452
releaseBranchFormat='release-v'
4553
if [[ ${{ github.ref_name }} == ${releaseBranchFormat}* ]]; then
4654
tag=v$(echo ${{ github.ref_name }}|sed "s,${releaseBranchFormat},,")
@@ -50,6 +58,7 @@ jobs:
5058
# Sanitize the tag by replacing invalid characters with hyphens
5159
tag=$(echo ${{ github.ref_name }}|sed 's,/merge,,' | sed 's,[/.],-,g')
5260
fi
61+
ko login -u ${OSP_PAC_TOKEN} -u os_pac ghcr.io
5362
for image in ./cmd/*;do
5463
ko build -B -t "${tag}" --platform="${{ env.PLATFORMS }}" "${image}"
5564
done

0 commit comments

Comments
 (0)