Compare commits
11
Commits
3edb5c03a4
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac0b78015b | ||
|
|
458fc6250d | ||
|
|
ccfa24c062 | ||
|
|
48fd1c0beb | ||
|
|
0e0f3da65b | ||
|
|
a09873d5db | ||
|
|
9d7c0f9726 | ||
|
|
2f61df9654 | ||
|
|
892de51ec2 | ||
|
|
0b265950d7 | ||
|
|
313e43e935 |
No files matched your search
+5
-2
@@ -1,9 +1,12 @@
|
|||||||
# @actions/github Releases
|
# @actions/github Releases
|
||||||
|
|
||||||
|
### 9.1.1
|
||||||
|
|
||||||
|
- Bump `undici` from `6.23.0` to `6.24.0` [#2346](https://github.com/actions/toolkit/pull/2346)
|
||||||
|
|
||||||
### 9.1.0
|
### 9.1.0
|
||||||
|
|
||||||
- Append `actions_orchestration_id` to user-agent when `ACTIONS_ORCHESTRATION_ID` environment variable is set
|
- Append `actions_orchestration_id` to user-agent when the `ACTIONS_ORCHESTRATION_ID` environment variable is set [#2364](https://github.com/actions/toolkit/pull/2364)
|
||||||
- Export `getUserAgentWithOrchestrationId` from `@actions/github/lib/utils` for downstream consumers
|
|
||||||
|
|
||||||
### 9.0.0
|
### 9.0.0
|
||||||
|
|
||||||
|
|||||||
@@ -59,6 +59,12 @@ describe('orchestration ID support', () => {
|
|||||||
process.env['ACTIONS_ORCHESTRATION_ID'] = ' '
|
process.env['ACTIONS_ORCHESTRATION_ID'] = ' '
|
||||||
expect(getUserAgentWithOrchestrationId('my-app')).toBe('my-app')
|
expect(getUserAgentWithOrchestrationId('my-app')).toBe('my-app')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('does not duplicate orchestration ID if already present in base', () => {
|
||||||
|
process.env['ACTIONS_ORCHESTRATION_ID'] = 'abc-123'
|
||||||
|
const alreadyTagged = 'my-app actions_orchestration_id/abc-123'
|
||||||
|
expect(getUserAgentWithOrchestrationId(alreadyTagged)).toBe(alreadyTagged)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('public re-export', () => {
|
describe('public re-export', () => {
|
||||||
@@ -110,5 +116,15 @@ describe('orchestration ID support', () => {
|
|||||||
const opts = getOctokitOptions('fake-token')
|
const opts = getOctokitOptions('fake-token')
|
||||||
expect(opts.userAgent).toBe('actions_orchestration_id/bad_chars_here_')
|
expect(opts.userAgent).toBe('actions_orchestration_id/bad_chars_here_')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('does not duplicate orchestration ID when caller already applied it', () => {
|
||||||
|
process.env['ACTIONS_ORCHESTRATION_ID'] = 'test-orch-id'
|
||||||
|
const opts = getOctokitOptions('fake-token', {
|
||||||
|
userAgent: 'my-app actions_orchestration_id/test-orch-id'
|
||||||
|
})
|
||||||
|
expect(opts.userAgent).toBe(
|
||||||
|
'my-app actions_orchestration_id/test-orch-id'
|
||||||
|
)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
Generated
+5
-5
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/github",
|
"name": "@actions/github",
|
||||||
"version": "9.0.0",
|
"version": "9.1.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@actions/github",
|
"name": "@actions/github",
|
||||||
"version": "9.0.0",
|
"version": "9.1.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/http-client": "^3.0.2",
|
"@actions/http-client": "^3.0.2",
|
||||||
@@ -363,9 +363,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/undici": {
|
"node_modules/undici": {
|
||||||
"version": "6.23.0",
|
"version": "6.29.0",
|
||||||
"resolved": "https://registry.npmjs.org/undici/-/undici-6.23.0.tgz",
|
"resolved": "https://registry.npmjs.org/undici/-/undici-6.29.0.tgz",
|
||||||
"integrity": "sha512-VfQPToRA5FZs/qJxLIinmU59u0r7LXqoJkCzinq3ckNJp3vKEh7jTWN589YQ5+aoAC/TGRLyJLCPKcLQbM8r9g==",
|
"integrity": "sha512-R+RODBqp6i2pPflGdq+xIOUkl+RNfGgHwoinecKu/JCuf2uO06cOKoDbI2P7Dn6KcswdKwrczbU6IYJ6K8X+wg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.17"
|
"node": ">=18.17"
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/github",
|
"name": "@actions/github",
|
||||||
"version": "9.0.0",
|
"version": "9.1.1",
|
||||||
"description": "Actions github lib",
|
"description": "Actions github lib",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"github",
|
"github",
|
||||||
|
|||||||
@@ -49,8 +49,10 @@ export function getUserAgentWithOrchestrationId(
|
|||||||
const orchId = process.env['ACTIONS_ORCHESTRATION_ID']?.trim()
|
const orchId = process.env['ACTIONS_ORCHESTRATION_ID']?.trim()
|
||||||
if (orchId) {
|
if (orchId) {
|
||||||
const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_')
|
const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_')
|
||||||
|
const tag = `actions_orchestration_id/${sanitizedId}`
|
||||||
|
if (baseUserAgent?.includes(tag)) return baseUserAgent
|
||||||
const ua = baseUserAgent ? `${baseUserAgent} ` : ''
|
const ua = baseUserAgent ? `${baseUserAgent} ` : ''
|
||||||
return `${ua}actions_orchestration_id/${sanitizedId}`
|
return `${ua}${tag}`
|
||||||
}
|
}
|
||||||
return baseUserAgent
|
return baseUserAgent
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user