diff --git a/.github/workflows/init.yml b/.github/workflows/init.yml index 80f6743..4f234d3 100644 --- a/.github/workflows/init.yml +++ b/.github/workflows/init.yml @@ -1,23 +1,27 @@ -- name: Initialize update server repository context - id: init - run: | - set -e +name: Init Repo Context - # Canonical repo identifiers - REPO_SLUG="${GITHUB_REPOSITORY}" # owner/repo - REPO_NAME="${GITHUB_REPOSITORY##*/}" # repo - SERVER_URL="${GITHUB_SERVER_URL:-https://github.com}" +on: + workflow_dispatch: - # Update server XML source repository URL - UPDATE_XML_REPO_URL="${SERVER_URL}/${REPO_SLUG}" +permissions: + contents: read - echo "Resolved repository slug: ${REPO_SLUG}" - echo "Resolved repository name: ${REPO_NAME}" - echo "Resolved update XML repo URL: ${UPDATE_XML_REPO_URL}" +jobs: + init: + runs-on: ubuntu-latest + steps: + - name: Initialize update server repository context + id: init + shell: bash + run: | + set -euo pipefail - # Export for downstream steps - { - echo "repo_slug=${REPO_SLUG}" - echo "repo_name=${REPO_NAME}" - echo "update_xml_repo_url=${UPDATE_XML_REPO_URL}" - } >> "$GITHUB_OUTPUT" + REPO_SLUG="${GITHUB_REPOSITORY}" + SERVER_URL="${GITHUB_SERVER_URL:-https://github.com}" + UPDATE_XML_REPO_URL="${SERVER_URL}/${REPO_SLUG}" + + echo "update_xml_repo_url=${UPDATE_XML_REPO_URL}" >> "$GITHUB_OUTPUT" + + - name: Print resolved value + run: | + echo "UPDATE_XML_REPO_URL=${{ steps.init.outputs.update_xml_repo_url }}"