From dafbe96fce03beaf3a60a0d67bbcb5a86adf4487 Mon Sep 17 00:00:00 2001 From: nicomiguelino Date: Tue, 26 May 2026 09:02:25 -0700 Subject: [PATCH 1/2] ci: remove whoami steps from workflow files - Drop Screenly API whoami step from update-edge-app.yml (stage and production jobs) - Drop Screenly API whoami step from initialize-edge-app.yml --- .github/workflows/initialize-edge-app.yml | 21 ------------ .github/workflows/update-edge-app.yml | 42 ----------------------- 2 files changed, 63 deletions(-) diff --git a/.github/workflows/initialize-edge-app.yml b/.github/workflows/initialize-edge-app.yml index b0e21a3..183cecd 100644 --- a/.github/workflows/initialize-edge-app.yml +++ b/.github/workflows/initialize-edge-app.yml @@ -32,27 +32,6 @@ jobs: - uses: actions/checkout@v6 with: ref: ${{ inputs.environment == 'production' && 'main' || 'development' }} - # TODO: Refactor into Screenly/edge-apps-actions/whoami@v1 - # See https://github.com/Screenly/edge-apps-actions/issues/8 - - name: Screenly API whoami - env: - SCREENLY_API_TOKEN: ${{ secrets.SCREENLY_API_TOKEN }} - API_BASE_URL: ${{ vars.API_BASE_URL }} - run: | - set -euo pipefail - current_user=$( - curl -fsSL -H "Authorization: Token ${SCREENLY_API_TOKEN}" \ - "${API_BASE_URL}/api/v4.1/users" \ - | jq -r '.[0] | "\(.first_name) \(.last_name) <\(.email)>"' - ) - echo "Current User: ${current_user}" - current_team=$( - curl -fsSL -H "Authorization: Token ${SCREENLY_API_TOKEN}" \ - "${API_BASE_URL}/api/v4.1/teams" \ - | jq -r '.[] | select(.is_current == true) - | "\(.name) (\(.domain))"' - ) - echo "Current Team: ${current_team}" - uses: Screenly/edge-apps-actions/initialize@v1 with: screenly_api_token: ${{ secrets.SCREENLY_API_TOKEN }} diff --git a/.github/workflows/update-edge-app.yml b/.github/workflows/update-edge-app.yml index cdf6344..8304746 100644 --- a/.github/workflows/update-edge-app.yml +++ b/.github/workflows/update-edge-app.yml @@ -18,27 +18,6 @@ jobs: environment: stage steps: - uses: actions/checkout@v6 - # TODO: Refactor into Screenly/edge-apps-actions/whoami@v1 - # See https://github.com/Screenly/edge-apps-actions/issues/8 - - name: Screenly API whoami - env: - SCREENLY_API_TOKEN: ${{ secrets.SCREENLY_API_TOKEN }} - API_BASE_URL: ${{ vars.API_BASE_URL }} - run: | - set -euo pipefail - current_user=$( - curl -fsSL -H "Authorization: Token ${SCREENLY_API_TOKEN}" \ - "${API_BASE_URL}/api/v4.1/users" \ - | jq -r '.[0] | "\(.first_name) \(.last_name) <\(.email)>"' - ) - echo "Current User: ${current_user}" - current_team=$( - curl -fsSL -H "Authorization: Token ${SCREENLY_API_TOKEN}" \ - "${API_BASE_URL}/api/v4.1/teams" \ - | jq -r '.[] | select(.is_current == true) - | "\(.name) (\(.domain))"' - ) - echo "Current Team: ${current_team}" - uses: Screenly/edge-apps-actions/update@v1 with: screenly_api_token: ${{ secrets.SCREENLY_API_TOKEN }} @@ -52,27 +31,6 @@ jobs: environment: production steps: - uses: actions/checkout@v6 - # TODO: Refactor into Screenly/edge-apps-actions/whoami@v1 - # See https://github.com/Screenly/edge-apps-actions/issues/8 - - name: Screenly API whoami - env: - SCREENLY_API_TOKEN: ${{ secrets.SCREENLY_API_TOKEN }} - API_BASE_URL: ${{ vars.API_BASE_URL }} - run: | - set -euo pipefail - current_user=$( - curl -fsSL -H "Authorization: Token ${SCREENLY_API_TOKEN}" \ - "${API_BASE_URL}/api/v4.1/users" \ - | jq -r '.[0] | "\(.first_name) \(.last_name) <\(.email)>"' - ) - echo "Current User: ${current_user}" - current_team=$( - curl -fsSL -H "Authorization: Token ${SCREENLY_API_TOKEN}" \ - "${API_BASE_URL}/api/v4.1/teams" \ - | jq -r '.[] | select(.is_current == true) - | "\(.name) (\(.domain))"' - ) - echo "Current Team: ${current_team}" - uses: Screenly/edge-apps-actions/update@v1 with: screenly_api_token: ${{ secrets.SCREENLY_API_TOKEN }} From 1f8e77fc3e3bc32ea9263eec26523785a8da7a59 Mon Sep 17 00:00:00 2001 From: nicomiguelino Date: Tue, 26 May 2026 09:06:24 -0700 Subject: [PATCH 2/2] ci: use github.ref for stage checkout in initialize-edge-app.yml - Replace hardcoded 'development' ref with github.ref so stage deployments can be triggered from any branch --- .github/workflows/initialize-edge-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/initialize-edge-app.yml b/.github/workflows/initialize-edge-app.yml index 183cecd..46b89f1 100644 --- a/.github/workflows/initialize-edge-app.yml +++ b/.github/workflows/initialize-edge-app.yml @@ -31,7 +31,7 @@ jobs: steps: - uses: actions/checkout@v6 with: - ref: ${{ inputs.environment == 'production' && 'main' || 'development' }} + ref: ${{ inputs.environment == 'production' && 'main' || github.ref }} - uses: Screenly/edge-apps-actions/initialize@v1 with: screenly_api_token: ${{ secrets.SCREENLY_API_TOKEN }}