diff --git a/tests/get_github_app_token.py b/tests/get_github_app_token.py index 62dcf13..b0e39d0 100755 --- a/tests/get_github_app_token.py +++ b/tests/get_github_app_token.py @@ -132,8 +132,9 @@ def generate_installation_token(): print("Error: No installations found for this GitHub App", file=sys.stderr) sys.exit(1) - # Create installation token installation_id = installations[0]['id'] + + # Create installation token url = f"https://api.github.com/app/installations/{installation_id}/access_tokens" response = requests.post(url, headers=headers) response.raise_for_status() diff --git a/tests/test_e2e.sh b/tests/test_e2e.sh index 2045d27..3688442 100755 --- a/tests/test_e2e.sh +++ b/tests/test_e2e.sh @@ -459,9 +459,11 @@ echo >&2 "2. Creating remote GitHub repository: $REPO_FULL_NAME" log_cmd gh repo create "$REPO_FULL_NAME" --description "Temporary E2E test repo for update-pr-stack action" --public echo >&2 "Successfully created $REPO_FULL_NAME" -# Enable GitHub Actions on the new repository (may be disabled by default in CI environments) -echo >&2 "Enabling GitHub Actions on the repository..." -log_cmd gh api -X PUT "/repos/$REPO_FULL_NAME/actions/permissions" --input - <<< '{"enabled":true,"allowed_actions":"all"}' +# Log default GitHub Actions permissions (repo inherits org/user defaults) +echo >&2 "Checking repository Actions permissions..." +if ! log_cmd gh api "/repos/$REPO_FULL_NAME/actions/permissions"; then + echo >&2 "Warning: unable to read Actions permissions for $REPO_FULL_NAME" +fi # 3. Push initial state echo >&2 "3. Pushing initial state to remote..."