Skip to content

Commit c769f41

Browse files
authored
merge: combine v9 upgrade (PR #708) with createOctokit feature
Merges the @actions/github v9 upgrade branch into the createOctokit feature branch, combining ADR steps 1 and 3 into a single major release. Changes from v9 upgrade: - @actions/github 6.x → 9.0.0 (ESM-only) - @octokit/core v5→v7, plugin-request-log v4→v6, plugin-retry v6→v8 - tsconfig: moduleResolution bundler, module/target es2022 - ts-jest: module commonjs override for CJS test execution - License file updates for new dependency versions Conflict resolutions: - src/async-function.ts: v9 import style + createOctokit type - types/async-function.d.ts: aligned with .ts file - integration.yml: v9 UA checks + createOctokit test job - dist/index.js: rebuilt via ncc Additional fix: - getoctokit-integration.test.ts: use mock instead of direct @actions/github import (ESM-only v9 incompatible with Jest CJS) All 32 tests passing, TypeScript clean, lint clean.
2 parents 599b1f4 + c1a9577 commit c769f41

35 files changed

+57629
-28947
lines changed

.github/workflows/integration.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -154,28 +154,24 @@ jobs:
154154
return endpoint({}).headers['user-agent']
155155
result-encoding: string
156156
- run: |
157-
matches_user_agent() {
158-
local actual="$1"
159-
local prefix="$2"
160-
[[ "$actual" =~ ^${prefix}(\ actions_orchestration_id/[^[:space:]]+)?\ octokit-core\.js/ ]]
161-
}
162-
157+
# User-agent format: <prefix> [actions_orchestration_id/<id>] octokit-core.js/<version> ...
158+
# When ACTIONS_ORCHESTRATION_ID is set, the orchestration ID is inserted after the prefix
163159
echo "- Validating user-agent default"
164-
expected="actions/github-script"
165-
if ! matches_user_agent "${{steps.user-agent-default.outputs.result}}" "$expected"; then
166-
echo $'::error::\u274C' "Expected user-agent to start with '$expected' and include 'octokit-core.js/', got ${{steps.user-agent-default.outputs.result}}"
160+
ua="${{steps.user-agent-default.outputs.result}}"
161+
if [[ "$ua" != "actions/github-script"* ]] || [[ "$ua" != *"octokit-core.js/"* ]]; then
162+
echo $'::error::\u274C' "Expected user-agent to start with 'actions/github-script' and contain 'octokit-core.js/', got $ua"
167163
exit 1
168164
fi
169165
echo "- Validating user-agent set to a value"
170-
expected="foobar"
171-
if ! matches_user_agent "${{steps.user-agent-set.outputs.result}}" "$expected"; then
172-
echo $'::error::\u274C' "Expected user-agent to start with '$expected' and include 'octokit-core.js/', got ${{steps.user-agent-set.outputs.result}}"
166+
ua="${{steps.user-agent-set.outputs.result}}"
167+
if [[ "$ua" != "foobar"* ]] || [[ "$ua" != *"octokit-core.js/"* ]]; then
168+
echo $'::error::\u274C' "Expected user-agent to start with 'foobar' and contain 'octokit-core.js/', got $ua"
173169
exit 1
174170
fi
175171
echo "- Validating user-agent set to an empty string"
176-
expected="actions/github-script"
177-
if ! matches_user_agent "${{steps.user-agent-empty.outputs.result}}" "$expected"; then
178-
echo $'::error::\u274C' "Expected user-agent to start with '$expected' and include 'octokit-core.js/', got ${{steps.user-agent-empty.outputs.result}}"
172+
ua="${{steps.user-agent-empty.outputs.result}}"
173+
if [[ "$ua" != "actions/github-script"* ]] || [[ "$ua" != *"octokit-core.js/"* ]]; then
174+
echo $'::error::\u274C' "Expected user-agent to start with 'actions/github-script' and contain 'octokit-core.js/', got $ua"
179175
exit 1
180176
fi
181177
echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY

.licenses/npm/@actions/github.dep.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

.licenses/npm/@actions/http-client-3.0.2.dep.yml

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@octokit/auth-token.dep.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@octokit/core.dep.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@octokit/endpoint.dep.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@octokit/graphql.dep.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@octokit/openapi-types-19.0.0.dep.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.licenses/npm/@octokit/openapi-types-18.0.0.dep.yml renamed to .licenses/npm/@octokit/openapi-types.dep.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)