Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf627a5a44 | ||
|
|
f83fb279aa | ||
|
|
4b73c38a52 | ||
|
|
e8e39f73bb | ||
|
|
1e02bd5721 | ||
|
|
5195df7c88 | ||
|
|
f4c6bf6752 | ||
|
|
1f82f7df93 | ||
|
|
1f18aabaea | ||
|
|
86576b355d | ||
|
|
837e2752e0 | ||
|
|
c4fa18d55c | ||
|
|
0c014070f9 | ||
|
|
f04aa94d10 | ||
|
|
323044ff31 | ||
|
|
936979e9ad | ||
|
|
2986852ad8 | ||
|
|
495056a515 | ||
|
|
8746053070 |
50
README.md
50
README.md
@@ -15,7 +15,11 @@ In order to use this action, you need to:
|
|||||||
### Create a token for the current repository
|
### Create a token for the current repository
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
on: [issues]
|
name: Run tests on staging
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
hello-world:
|
hello-world:
|
||||||
@@ -26,11 +30,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
app-id: ${{ vars.APP_ID }}
|
app-id: ${{ vars.APP_ID }}
|
||||||
private-key: ${{ secrets.PRIVATE_KEY }}
|
private-key: ${{ secrets.PRIVATE_KEY }}
|
||||||
- uses: peter-evans/create-or-update-comment@v3
|
github-api-url: "https://github.acme-inc.com/api/v3"
|
||||||
|
- uses: ./actions/staging-tests
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.app-token.outputs.token }}
|
token: ${{ steps.app-token.outputs.token }}
|
||||||
issue-number: ${{ github.event.issue.number }}
|
|
||||||
body: "Hello, World!"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Use app token with `actions/checkout`
|
### Use app token with `actions/checkout`
|
||||||
@@ -146,7 +149,7 @@ jobs:
|
|||||||
run: echo 'matrix=[{"owner":"owner1"},{"owner":"owner2","repos":["repo1"]}]' >>"$GITHUB_OUTPUT"
|
run: echo 'matrix=[{"owner":"owner1"},{"owner":"owner2","repos":["repo1"]}]' >>"$GITHUB_OUTPUT"
|
||||||
|
|
||||||
use-matrix:
|
use-matrix:
|
||||||
name: '@${{ matrix.owners-and-repos.owner }} installation'
|
name: "@${{ matrix.owners-and-repos.owner }} installation"
|
||||||
needs: [set-matrix]
|
needs: [set-matrix]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
@@ -157,8 +160,8 @@ jobs:
|
|||||||
- uses: actions/create-github-app-token@v1
|
- uses: actions/create-github-app-token@v1
|
||||||
id: app-token
|
id: app-token
|
||||||
with:
|
with:
|
||||||
app_id: ${{ vars.APP_ID }}
|
app-id: ${{ vars.APP_ID }}
|
||||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
private-key: ${{ secrets.PRIVATE_KEY }}
|
||||||
owner: ${{ matrix.owners-and-repos.owner }}
|
owner: ${{ matrix.owners-and-repos.owner }}
|
||||||
repositories: ${{ join(matrix.owners-and-repos.repos) }}
|
repositories: ${{ join(matrix.owners-and-repos.repos) }}
|
||||||
- uses: octokit/request-action@v2.x
|
- uses: octokit/request-action@v2.x
|
||||||
@@ -172,6 +175,35 @@ jobs:
|
|||||||
MULTILINE_JSON_STRING: ${{ steps.get-installation-repositories.outputs.data }}
|
MULTILINE_JSON_STRING: ${{ steps.get-installation-repositories.outputs.data }}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Run the workflow in a github.com repository against an organization in GitHub Enterprise Server
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
create_issue:
|
||||||
|
runs-on: self-hosted
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Create GitHub App token
|
||||||
|
id: create_token
|
||||||
|
uses: actions/create-github-app-token@v1
|
||||||
|
with:
|
||||||
|
app-id: ${{ vars.GHES_APP_ID }}
|
||||||
|
private-key: ${{ secrets.GHES_APP_PRIVATE_KEY }}
|
||||||
|
owner: ${{ vars.GHES_INSTALLATION_ORG }}
|
||||||
|
github-api-url: ${{ vars.GITHUB_API_URL }}
|
||||||
|
|
||||||
|
- name: Create issue
|
||||||
|
uses: octokit/request-action@v2.x
|
||||||
|
with:
|
||||||
|
route: POST /repos/${{ github.repository }}/issues
|
||||||
|
title: "New issue from workflow"
|
||||||
|
body: "This is a new issue created from a GitHub Action workflow."
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ steps.create_token.outputs.token }}
|
||||||
|
```
|
||||||
|
|
||||||
## Inputs
|
## Inputs
|
||||||
|
|
||||||
### `app-id`
|
### `app-id`
|
||||||
@@ -197,6 +229,10 @@ jobs:
|
|||||||
|
|
||||||
**Optional:** If truthy, the token will not be revoked when the current job is complete.
|
**Optional:** If truthy, the token will not be revoked when the current job is complete.
|
||||||
|
|
||||||
|
### `github-api-url`
|
||||||
|
|
||||||
|
**Optional:** The URL of the GitHub REST API. Defaults to the URL of the GitHub Rest API where the workflow is run from.
|
||||||
|
|
||||||
## Outputs
|
## Outputs
|
||||||
|
|
||||||
### `token`
|
### `token`
|
||||||
|
|||||||
@@ -32,6 +32,11 @@ inputs:
|
|||||||
description: "If truthy, the token will not be revoked when the current job is complete"
|
description: "If truthy, the token will not be revoked when the current job is complete"
|
||||||
required: false
|
required: false
|
||||||
deprecationMessage: "'skip_token_revoke' is deprecated and will be removed in a future version. Use 'skip-token-revoke' instead."
|
deprecationMessage: "'skip_token_revoke' is deprecated and will be removed in a future version. Use 'skip-token-revoke' instead."
|
||||||
|
# Make GitHub API configurable to support non-GitHub Cloud use cases
|
||||||
|
# see https://github.com/actions/create-github-app-token/issues/77
|
||||||
|
github-api-url:
|
||||||
|
description: The URL of the GitHub REST API.
|
||||||
|
default: ${{ github.api_url }}
|
||||||
outputs:
|
outputs:
|
||||||
token:
|
token:
|
||||||
description: "GitHub installation access token"
|
description: "GitHub installation access token"
|
||||||
|
|||||||
21206
dist/main.cjs
vendored
21206
dist/main.cjs
vendored
File diff suppressed because one or more lines are too long
18854
dist/post.cjs
vendored
18854
dist/post.cjs
vendored
File diff suppressed because one or more lines are too long
25
lib/main.js
25
lib/main.js
@@ -70,15 +70,11 @@ export async function main(
|
|||||||
request,
|
request,
|
||||||
});
|
});
|
||||||
|
|
||||||
const appAuthentication = await auth({
|
|
||||||
type: "app",
|
|
||||||
});
|
|
||||||
|
|
||||||
let authentication;
|
let authentication;
|
||||||
// If at least one repository is set, get installation ID from that repository
|
// If at least one repository is set, get installation ID from that repository
|
||||||
|
|
||||||
if (parsedRepositoryNames) {
|
if (parsedRepositoryNames) {
|
||||||
authentication = await pRetry(() => getTokenFromRepository(request, auth, parsedOwner,appAuthentication, parsedRepositoryNames), {
|
authentication = await pRetry(() => getTokenFromRepository(request, auth, parsedOwner, parsedRepositoryNames), {
|
||||||
onFailedAttempt: (error) => {
|
onFailedAttempt: (error) => {
|
||||||
core.info(
|
core.info(
|
||||||
`Failed to create token for "${parsedRepositoryNames}" (attempt ${error.attemptNumber}): ${error.message}`
|
`Failed to create token for "${parsedRepositoryNames}" (attempt ${error.attemptNumber}): ${error.message}`
|
||||||
@@ -89,7 +85,7 @@ export async function main(
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Otherwise get the installation for the owner, which can either be an organization or a user account
|
// Otherwise get the installation for the owner, which can either be an organization or a user account
|
||||||
authentication = await pRetry(() => getTokenFromOwner(request, auth, appAuthentication, parsedOwner), {
|
authentication = await pRetry(() => getTokenFromOwner(request, auth, parsedOwner), {
|
||||||
onFailedAttempt: (error) => {
|
onFailedAttempt: (error) => {
|
||||||
core.info(
|
core.info(
|
||||||
`Failed to create token for "${parsedOwner}" (attempt ${error.attemptNumber}): ${error.message}`
|
`Failed to create token for "${parsedOwner}" (attempt ${error.attemptNumber}): ${error.message}`
|
||||||
@@ -107,15 +103,16 @@ export async function main(
|
|||||||
// Make token accessible to post function (so we can invalidate it)
|
// Make token accessible to post function (so we can invalidate it)
|
||||||
if (!skipTokenRevoke) {
|
if (!skipTokenRevoke) {
|
||||||
core.saveState("token", authentication.token);
|
core.saveState("token", authentication.token);
|
||||||
|
core.setOutput("expiresAt", authentication.expiresAt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getTokenFromOwner(request, auth, appAuthentication, parsedOwner) {
|
async function getTokenFromOwner(request, auth, parsedOwner) {
|
||||||
// https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#get-an-organization-installation-for-the-authenticated-app
|
// https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#get-an-organization-installation-for-the-authenticated-app
|
||||||
const response = await request("GET /orgs/{org}/installation", {
|
const response = await request("GET /orgs/{org}/installation", {
|
||||||
org: parsedOwner,
|
org: parsedOwner,
|
||||||
headers: {
|
request: {
|
||||||
authorization: `bearer ${appAuthentication.token}`,
|
hook: auth.hook,
|
||||||
},
|
},
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
/* c8 ignore next */
|
/* c8 ignore next */
|
||||||
@@ -124,8 +121,8 @@ async function getTokenFromOwner(request, auth, appAuthentication, parsedOwner)
|
|||||||
// https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-a-user-installation-for-the-authenticated-app
|
// https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-a-user-installation-for-the-authenticated-app
|
||||||
return request("GET /users/{username}/installation", {
|
return request("GET /users/{username}/installation", {
|
||||||
username: parsedOwner,
|
username: parsedOwner,
|
||||||
headers: {
|
request: {
|
||||||
authorization: `bearer ${appAuthentication.token}`,
|
hook: auth.hook,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -138,13 +135,13 @@ async function getTokenFromOwner(request, auth, appAuthentication, parsedOwner)
|
|||||||
return authentication;
|
return authentication;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getTokenFromRepository(request, auth, parsedOwner,appAuthentication, parsedRepositoryNames) {
|
async function getTokenFromRepository(request, auth, parsedOwner, parsedRepositoryNames) {
|
||||||
// https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-a-repository-installation-for-the-authenticated-app
|
// https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-a-repository-installation-for-the-authenticated-app
|
||||||
const response = await request("GET /repos/{owner}/{repo}/installation", {
|
const response = await request("GET /repos/{owner}/{repo}/installation", {
|
||||||
owner: parsedOwner,
|
owner: parsedOwner,
|
||||||
repo: parsedRepositoryNames.split(",")[0],
|
repo: parsedRepositoryNames.split(",")[0],
|
||||||
headers: {
|
request: {
|
||||||
authorization: `bearer ${appAuthentication.token}`,
|
hook: auth.hook,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
32
lib/post.js
32
lib/post.js
@@ -21,11 +21,31 @@ export async function post(core, request) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await request("DELETE /installation/token", {
|
const expiresAt = core.getState("expiresAt");
|
||||||
headers: {
|
if (expiresAt && tokenExpiresIn(expiresAt) < 0) {
|
||||||
authorization: `token ${token}`,
|
core.info("Token expired, skipping token revocation");
|
||||||
},
|
return;
|
||||||
});
|
}
|
||||||
|
|
||||||
core.info("Token revoked");
|
try {
|
||||||
|
await request("DELETE /installation/token", {
|
||||||
|
headers: {
|
||||||
|
authorization: `token ${token}`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
core.info("Token revoked");
|
||||||
|
} catch (error) {
|
||||||
|
core.warning(
|
||||||
|
`Token revocation failed: ${error.message}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} expiresAt
|
||||||
|
*/
|
||||||
|
function tokenExpiresIn(expiresAt) {
|
||||||
|
const now = new Date();
|
||||||
|
const expiresAtDate = new Date(expiresAt);
|
||||||
|
|
||||||
|
return Math.round((expiresAtDate.getTime() - now.getTime()) / 1000);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,41 @@
|
|||||||
|
import core from "@actions/core";
|
||||||
import { request } from "@octokit/request";
|
import { request } from "@octokit/request";
|
||||||
|
import { ProxyAgent, fetch as undiciFetch } from "undici";
|
||||||
|
|
||||||
|
const baseUrl = core.getInput("github-api-url").replace(/\/$/, "");
|
||||||
|
|
||||||
|
// https://docs.github.com/actions/hosting-your-own-runners/managing-self-hosted-runners/using-a-proxy-server-with-self-hosted-runners
|
||||||
|
const proxyUrl =
|
||||||
|
process.env.https_proxy ||
|
||||||
|
process.env.HTTPS_PROXY ||
|
||||||
|
process.env.http_proxy ||
|
||||||
|
process.env.HTTP_PROXY;
|
||||||
|
|
||||||
|
/* c8 ignore start */
|
||||||
|
// Native support for proxies in Undici is under consideration: https://github.com/nodejs/undici/issues/1650
|
||||||
|
// Until then, we need to use a custom fetch function to add proxy support.
|
||||||
|
const proxyFetch = (url, options) => {
|
||||||
|
const urlHost = new URL(url).hostname;
|
||||||
|
const noProxy = (process.env.no_proxy || process.env.NO_PROXY || "").split(
|
||||||
|
","
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!noProxy.includes(urlHost)) {
|
||||||
|
options = {
|
||||||
|
...options,
|
||||||
|
dispatcher: new ProxyAgent(String(proxyUrl)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return undiciFetch(url, options);
|
||||||
|
};
|
||||||
|
/* c8 ignore stop */
|
||||||
|
|
||||||
export default request.defaults({
|
export default request.defaults({
|
||||||
baseUrl: process.env["GITHUB_API_URL"],
|
|
||||||
headers: {
|
headers: {
|
||||||
"user-agent": "actions/create-github-app-token",
|
"user-agent": "actions/create-github-app-token",
|
||||||
},
|
},
|
||||||
|
baseUrl,
|
||||||
|
/* c8 ignore next */
|
||||||
|
request: proxyUrl ? { fetch: proxyFetch } : {},
|
||||||
});
|
});
|
||||||
|
|||||||
4
main.js
4
main.js
@@ -38,9 +38,7 @@ main(
|
|||||||
repositories,
|
repositories,
|
||||||
core,
|
core,
|
||||||
createAppAuth,
|
createAppAuth,
|
||||||
request.defaults({
|
request,
|
||||||
baseUrl: process.env["GITHUB_API_URL"],
|
|
||||||
}),
|
|
||||||
skipTokenRevoke
|
skipTokenRevoke
|
||||||
).catch((error) => {
|
).catch((error) => {
|
||||||
/* c8 ignore next 3 */
|
/* c8 ignore next 3 */
|
||||||
|
|||||||
2570
package-lock.json
generated
2570
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
23
package.json
23
package.json
@@ -2,7 +2,7 @@
|
|||||||
"name": "create-github-app-token",
|
"name": "create-github-app-token",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.6.1",
|
"version": "1.8.2",
|
||||||
"description": "GitHub Action for creating a GitHub App Installation Access Token",
|
"description": "GitHub Action for creating a GitHub App Installation Access Token",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "esbuild main.js post.js --bundle --outdir=dist --out-extension:.js=.cjs --platform=node --target=node20.0.0",
|
"build": "esbuild main.js post.js --bundle --outdir=dist --out-extension:.js=.cjs --platform=node --target=node20.0.0",
|
||||||
@@ -13,19 +13,20 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.1",
|
"@actions/core": "^1.10.1",
|
||||||
"@octokit/auth-app": "^6.0.1",
|
"@octokit/auth-app": "^6.0.4",
|
||||||
"@octokit/request": "^8.1.6",
|
"@octokit/request": "^9.0.1",
|
||||||
"p-retry": "^6.1.0"
|
"p-retry": "^6.2.0",
|
||||||
|
"undici": "^6.6.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"ava": "^5.3.1",
|
"@sinonjs/fake-timers": "^11.2.2",
|
||||||
"c8": "^8.0.1",
|
"ava": "^6.1.2",
|
||||||
"dotenv": "^16.3.1",
|
"c8": "^9.1.0",
|
||||||
"esbuild": "^0.19.8",
|
"dotenv": "^16.4.5",
|
||||||
|
"esbuild": "^0.20.1",
|
||||||
"execa": "^8.0.1",
|
"execa": "^8.0.1",
|
||||||
"open-cli": "^7.2.0",
|
"open-cli": "^8.0.0",
|
||||||
"undici": "^5.28.2",
|
"yaml": "^2.4.0"
|
||||||
"yaml": "^2.3.4"
|
|
||||||
},
|
},
|
||||||
"release": {
|
"release": {
|
||||||
"branches": [
|
"branches": [
|
||||||
|
|||||||
7
post.js
7
post.js
@@ -5,12 +5,7 @@ import core from "@actions/core";
|
|||||||
import { post } from "./lib/post.js";
|
import { post } from "./lib/post.js";
|
||||||
import request from "./lib/request.js";
|
import request from "./lib/request.js";
|
||||||
|
|
||||||
post(
|
post(core, request).catch((error) => {
|
||||||
core,
|
|
||||||
request.defaults({
|
|
||||||
baseUrl: process.env["GITHUB_API_URL"],
|
|
||||||
})
|
|
||||||
).catch((error) => {
|
|
||||||
/* c8 ignore next 3 */
|
/* c8 ignore next 3 */
|
||||||
console.error(error);
|
console.error(error);
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
|
|||||||
13
tests/main-custom-github-api-url.test.js
Normal file
13
tests/main-custom-github-api-url.test.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { test, DEFAULT_ENV } from "./main.js";
|
||||||
|
|
||||||
|
// Verify that main works with a custom GitHub API URL passed as `github-api-url` input
|
||||||
|
await test(
|
||||||
|
() => {
|
||||||
|
process.env.INPUT_OWNER = process.env.GITHUB_REPOSITORY_OWNER;
|
||||||
|
process.env.INPUT_REPOSITORIES = process.env.GITHUB_REPOSITORY;
|
||||||
|
},
|
||||||
|
{
|
||||||
|
...DEFAULT_ENV,
|
||||||
|
"INPUT_GITHUB-API-URL": "https://github.acme-inc.com/api/v3",
|
||||||
|
}
|
||||||
|
);
|
||||||
56
tests/main-repo-skew.js
Normal file
56
tests/main-repo-skew.js
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
import { test } from "./main.js";
|
||||||
|
|
||||||
|
import { install } from "@sinonjs/fake-timers";
|
||||||
|
|
||||||
|
// Verify `main` retry when the clock has drifted.
|
||||||
|
await test((mockPool) => {
|
||||||
|
process.env.INPUT_OWNER = 'actions'
|
||||||
|
process.env.INPUT_REPOSITORIES = 'failed-repo';
|
||||||
|
const owner = process.env.INPUT_OWNER
|
||||||
|
const repo = process.env.INPUT_REPOSITORIES
|
||||||
|
const mockInstallationId = "123456";
|
||||||
|
|
||||||
|
install({ now: 0, toFake: ["Date"] });
|
||||||
|
|
||||||
|
mockPool
|
||||||
|
.intercept({
|
||||||
|
path: `/repos/${owner}/${repo}/installation`,
|
||||||
|
method: "GET",
|
||||||
|
headers: {
|
||||||
|
accept: "application/vnd.github.v3+json",
|
||||||
|
"user-agent": "actions/create-github-app-token",
|
||||||
|
// Intentionally omitting the `authorization` header, since JWT creation is not idempotent.
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.reply(({ headers }) => {
|
||||||
|
const [_, jwt] = (headers.authorization || "").split(" ");
|
||||||
|
const payload = JSON.parse(Buffer.from(jwt.split(".")[1], "base64").toString());
|
||||||
|
|
||||||
|
if (payload.iat < 0) {
|
||||||
|
return {
|
||||||
|
statusCode: 401,
|
||||||
|
data: {
|
||||||
|
message: "'Issued at' claim ('iat') must be an Integer representing the time that the assertion was issued."
|
||||||
|
},
|
||||||
|
responseOptions: {
|
||||||
|
headers: {
|
||||||
|
"content-type": "application/json",
|
||||||
|
"date": new Date(Date.now() + 30000).toUTCString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
statusCode: 200,
|
||||||
|
data: {
|
||||||
|
id: mockInstallationId
|
||||||
|
},
|
||||||
|
responseOptions: {
|
||||||
|
headers: {
|
||||||
|
"content-type": "application/json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}).times(2);
|
||||||
|
});
|
||||||
@@ -2,10 +2,10 @@ import { test } from "./main.js";
|
|||||||
|
|
||||||
// Verify `main` retry when the GitHub API returns a 500 error.
|
// Verify `main` retry when the GitHub API returns a 500 error.
|
||||||
await test((mockPool) => {
|
await test((mockPool) => {
|
||||||
process.env.INPUT_OWNER = 'actions'
|
process.env.INPUT_OWNER = "actions";
|
||||||
process.env.INPUT_REPOSITORIES = 'failed-repo';
|
process.env.INPUT_REPOSITORIES = "failed-repo";
|
||||||
const owner = process.env.INPUT_OWNER
|
const owner = process.env.INPUT_OWNER;
|
||||||
const repo = process.env.INPUT_REPOSITORIES
|
const repo = process.env.INPUT_REPOSITORIES;
|
||||||
const mockInstallationId = "123456";
|
const mockInstallationId = "123456";
|
||||||
|
|
||||||
mockPool
|
mockPool
|
||||||
@@ -18,9 +18,9 @@ await test((mockPool) => {
|
|||||||
// Intentionally omitting the `authorization` header, since JWT creation is not idempotent.
|
// Intentionally omitting the `authorization` header, since JWT creation is not idempotent.
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.reply(500, 'GitHub API not available')
|
.reply(500, "GitHub API not available");
|
||||||
|
|
||||||
mockPool
|
mockPool
|
||||||
.intercept({
|
.intercept({
|
||||||
path: `/repos/${owner}/${repo}/installation`,
|
path: `/repos/${owner}/${repo}/installation`,
|
||||||
method: "GET",
|
method: "GET",
|
||||||
@@ -35,5 +35,4 @@ await test((mockPool) => {
|
|||||||
{ id: mockInstallationId },
|
{ id: mockInstallationId },
|
||||||
{ headers: { "content-type": "application/json" } }
|
{ headers: { "content-type": "application/json" } }
|
||||||
);
|
);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ await test((mockPool) => {
|
|||||||
// Intentionally omitting the `authorization` header, since JWT creation is not idempotent.
|
// Intentionally omitting the `authorization` header, since JWT creation is not idempotent.
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.reply(500, 'GitHub API not available')
|
.reply(500, "GitHub API not available");
|
||||||
mockPool
|
mockPool
|
||||||
.intercept({
|
.intercept({
|
||||||
path: `/orgs/${process.env.INPUT_OWNER}/installation`,
|
path: `/orgs/${process.env.INPUT_OWNER}/installation`,
|
||||||
method: "GET",
|
method: "GET",
|
||||||
|
|||||||
@@ -2,14 +2,15 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
import { MockAgent, setGlobalDispatcher } from "undici";
|
import { MockAgent, setGlobalDispatcher } from "undici";
|
||||||
|
|
||||||
export async function test(cb = (_mockPool) => {}) {
|
export const DEFAULT_ENV = {
|
||||||
// Set required environment variables and inputs
|
GITHUB_REPOSITORY_OWNER: "actions",
|
||||||
process.env.GITHUB_REPOSITORY_OWNER = "actions";
|
GITHUB_REPOSITORY: "actions/create-github-app-token",
|
||||||
process.env.GITHUB_REPOSITORY = "actions/create-github-app-token";
|
|
||||||
// inputs are set as environment variables with the prefix INPUT_
|
// inputs are set as environment variables with the prefix INPUT_
|
||||||
// https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#example-specifying-inputs
|
// https://docs.github.com/actions/creating-actions/metadata-syntax-for-github-actions#example-specifying-inputs
|
||||||
process.env["INPUT_APP-ID"] = "123456";
|
"INPUT_GITHUB-API-URL": "https://api.github.com",
|
||||||
process.env["INPUT_PRIVATE-KEY"] = `-----BEGIN RSA PRIVATE KEY-----
|
"INPUT_APP-ID": "123456",
|
||||||
|
// This key is invalidated. It’s from https://github.com/octokit/auth-app.js/issues/465#issuecomment-1564998327.
|
||||||
|
"INPUT_PRIVATE-KEY": `-----BEGIN RSA PRIVATE KEY-----
|
||||||
MIIEowIBAAKCAQEA280nfuUM9w00Ib9E2rvZJ6Qu3Ua3IqR34ZlK53vn/Iobn2EL
|
MIIEowIBAAKCAQEA280nfuUM9w00Ib9E2rvZJ6Qu3Ua3IqR34ZlK53vn/Iobn2EL
|
||||||
Z9puc5Q/nFBU15NKwHyQNb+OG2hTCkjd1Xi9XPzEOH1r42YQmTGq8YCkUSkk6KZA
|
Z9puc5Q/nFBU15NKwHyQNb+OG2hTCkjd1Xi9XPzEOH1r42YQmTGq8YCkUSkk6KZA
|
||||||
5dnhLwN9pFquT9fQgrf4r1D5GJj3rqvj8JDr1sBmunArqY5u4gziSrIohcjLIZV0
|
5dnhLwN9pFquT9fQgrf4r1D5GJj3rqvj8JDr1sBmunArqY5u4gziSrIohcjLIZV0
|
||||||
@@ -35,27 +36,33 @@ r4J2gqb0xTDfq7gLMNrIXc2QQM4gKbnJp60JQM3p9NmH8huavBZGvSvNzTwXyGG3
|
|||||||
so0tiQKBgGQXZaxaXhYUcxYHuCkQ3V4Vsj3ezlM92xXlP32SGFm3KgFhYy9kATxw
|
so0tiQKBgGQXZaxaXhYUcxYHuCkQ3V4Vsj3ezlM92xXlP32SGFm3KgFhYy9kATxw
|
||||||
Cax1ytZzvlrKLQyQFVK1COs2rHt7W4cJ7op7C8zXfsigXCiejnS664oAuX8sQZID
|
Cax1ytZzvlrKLQyQFVK1COs2rHt7W4cJ7op7C8zXfsigXCiejnS664oAuX8sQZID
|
||||||
x3WQZRiXlWejSMUAHuMwXrhGlltF3lw83+xAjnqsVp75kGS6OH61
|
x3WQZRiXlWejSMUAHuMwXrhGlltF3lw83+xAjnqsVp75kGS6OH61
|
||||||
-----END RSA PRIVATE KEY-----`; // This key is invalidated. It’s from https://github.com/octokit/auth-app.js/issues/465#issuecomment-1564998327.
|
-----END RSA PRIVATE KEY-----`,
|
||||||
|
};
|
||||||
|
|
||||||
|
export async function test(cb = (_mockPool) => {}, env = DEFAULT_ENV) {
|
||||||
|
for (const [key, value] of Object.entries(env)) {
|
||||||
|
process.env[key] = value;
|
||||||
|
}
|
||||||
|
|
||||||
// Set up mocking
|
// Set up mocking
|
||||||
|
const baseUrl = new URL(env["INPUT_GITHUB-API-URL"]);
|
||||||
|
const basePath = baseUrl.pathname === '/' ? '' : baseUrl.pathname;
|
||||||
const mockAgent = new MockAgent();
|
const mockAgent = new MockAgent();
|
||||||
mockAgent.disableNetConnect();
|
mockAgent.disableNetConnect();
|
||||||
setGlobalDispatcher(mockAgent);
|
setGlobalDispatcher(mockAgent);
|
||||||
const mockPool = mockAgent.get("https://api.github.com");
|
const mockPool = mockAgent.get(baseUrl.origin);
|
||||||
|
|
||||||
// Calling `auth({ type: "app" })` to obtain a JWT doesn’t make network requests, so no need to intercept.
|
// Calling `auth({ type: "app" })` to obtain a JWT doesn’t make network requests, so no need to intercept.
|
||||||
|
|
||||||
// Mock installation id request
|
// Mock installation id request
|
||||||
const mockInstallationId = "123456";
|
const mockInstallationId = "123456";
|
||||||
const owner = process.env.INPUT_OWNER ?? process.env.GITHUB_REPOSITORY_OWNER;
|
const owner = env.INPUT_OWNER ?? env.GITHUB_REPOSITORY_OWNER;
|
||||||
const repo = encodeURIComponent(
|
const repo = encodeURIComponent(
|
||||||
(process.env.INPUT_REPOSITORIES ?? process.env.GITHUB_REPOSITORY).split(
|
(env.INPUT_REPOSITORIES ?? env.GITHUB_REPOSITORY).split(",")[0]
|
||||||
","
|
|
||||||
)[0]
|
|
||||||
);
|
);
|
||||||
mockPool
|
mockPool
|
||||||
.intercept({
|
.intercept({
|
||||||
path: `/repos/${owner}/${repo}/installation`,
|
path: `${basePath}/repos/${owner}/${repo}/installation`,
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: {
|
headers: {
|
||||||
accept: "application/vnd.github.v3+json",
|
accept: "application/vnd.github.v3+json",
|
||||||
@@ -72,9 +79,10 @@ x3WQZRiXlWejSMUAHuMwXrhGlltF3lw83+xAjnqsVp75kGS6OH61
|
|||||||
// Mock installation access token request
|
// Mock installation access token request
|
||||||
const mockInstallationAccessToken =
|
const mockInstallationAccessToken =
|
||||||
"ghs_16C7e42F292c6912E7710c838347Ae178B4a"; // This token is invalidated. It’s from https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app.
|
"ghs_16C7e42F292c6912E7710c838347Ae178B4a"; // This token is invalidated. It’s from https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app.
|
||||||
|
const mockExpiresAt = "2016-07-11T22:14:10Z";
|
||||||
mockPool
|
mockPool
|
||||||
.intercept({
|
.intercept({
|
||||||
path: `/app/installations/${mockInstallationId}/access_tokens`,
|
path: `${basePath}/app/installations/${mockInstallationId}/access_tokens`,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
accept: "application/vnd.github.v3+json",
|
accept: "application/vnd.github.v3+json",
|
||||||
@@ -84,7 +92,7 @@ x3WQZRiXlWejSMUAHuMwXrhGlltF3lw83+xAjnqsVp75kGS6OH61
|
|||||||
})
|
})
|
||||||
.reply(
|
.reply(
|
||||||
201,
|
201,
|
||||||
{ token: mockInstallationAccessToken },
|
{ token: mockInstallationAccessToken, expires_at: mockExpiresAt },
|
||||||
{ headers: { "content-type": "application/json" } }
|
{ headers: { "content-type": "application/json" } }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
34
tests/post-revoke-token-fail-response.test.js
Normal file
34
tests/post-revoke-token-fail-response.test.js
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
import { MockAgent, setGlobalDispatcher } from "undici";
|
||||||
|
|
||||||
|
// state variables are set as environment variables with the prefix STATE_
|
||||||
|
// https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#sending-values-to-the-pre-and-post-actions
|
||||||
|
process.env.STATE_token = "secret123";
|
||||||
|
|
||||||
|
// inputs are set as environment variables with the prefix INPUT_
|
||||||
|
// https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#example-specifying-inputs
|
||||||
|
process.env["INPUT_GITHUB-API-URL"] = "https://api.github.com";
|
||||||
|
|
||||||
|
// 1 hour in the future, not expired
|
||||||
|
process.env.STATE_expiresAt = new Date(
|
||||||
|
Date.now() + 1000 * 60 * 60
|
||||||
|
).toISOString();
|
||||||
|
|
||||||
|
const mockAgent = new MockAgent();
|
||||||
|
|
||||||
|
setGlobalDispatcher(mockAgent);
|
||||||
|
|
||||||
|
// Provide the base url to the request
|
||||||
|
const mockPool = mockAgent.get("https://api.github.com");
|
||||||
|
|
||||||
|
// intercept the request
|
||||||
|
mockPool
|
||||||
|
.intercept({
|
||||||
|
path: "/installation/token",
|
||||||
|
method: "DELETE",
|
||||||
|
headers: {
|
||||||
|
authorization: "token secret123",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.reply(401);
|
||||||
|
|
||||||
|
await import("../post.js");
|
||||||
28
tests/post-token-expired.test.js
Normal file
28
tests/post-token-expired.test.js
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import { MockAgent, setGlobalDispatcher } from "undici";
|
||||||
|
|
||||||
|
// state variables are set as environment variables with the prefix STATE_
|
||||||
|
// https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#sending-values-to-the-pre-and-post-actions
|
||||||
|
process.env.STATE_token = "secret123";
|
||||||
|
|
||||||
|
// 1 hour in the past, expired
|
||||||
|
process.env.STATE_expiresAt = new Date(Date.now() - 1000 * 60 * 60).toISOString();
|
||||||
|
|
||||||
|
const mockAgent = new MockAgent();
|
||||||
|
|
||||||
|
setGlobalDispatcher(mockAgent);
|
||||||
|
|
||||||
|
// Provide the base url to the request
|
||||||
|
const mockPool = mockAgent.get("https://api.github.com");
|
||||||
|
|
||||||
|
// intercept the request
|
||||||
|
mockPool
|
||||||
|
.intercept({
|
||||||
|
path: "/installation/token",
|
||||||
|
method: "DELETE",
|
||||||
|
headers: {
|
||||||
|
authorization: "token secret123",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.reply(204);
|
||||||
|
|
||||||
|
await import("../post.js");
|
||||||
@@ -4,6 +4,13 @@ import { MockAgent, setGlobalDispatcher } from "undici";
|
|||||||
// https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#sending-values-to-the-pre-and-post-actions
|
// https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#sending-values-to-the-pre-and-post-actions
|
||||||
process.env.STATE_token = "secret123";
|
process.env.STATE_token = "secret123";
|
||||||
|
|
||||||
|
// inputs are set as environment variables with the prefix INPUT_
|
||||||
|
// https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#example-specifying-inputs
|
||||||
|
process.env["INPUT_GITHUB-API-URL"] = "https://api.github.com";
|
||||||
|
|
||||||
|
// 1 hour in the future, not expired
|
||||||
|
process.env.STATE_expiresAt = new Date(Date.now() + 1000 * 60 * 60).toISOString();
|
||||||
|
|
||||||
const mockAgent = new MockAgent();
|
const mockAgent = new MockAgent();
|
||||||
|
|
||||||
setGlobalDispatcher(mockAgent);
|
setGlobalDispatcher(mockAgent);
|
||||||
|
|||||||
@@ -16,6 +16,22 @@ Generated by [AVA](https://avajs.dev).
|
|||||||
private_key — 'private_key' is deprecated and will be removed in a future version. Use 'private-key' instead.␊
|
private_key — 'private_key' is deprecated and will be removed in a future version. Use 'private-key' instead.␊
|
||||||
skip_token_revoke — 'skip_token_revoke' is deprecated and will be removed in a future version. Use 'skip-token-revoke' instead.`
|
skip_token_revoke — 'skip_token_revoke' is deprecated and will be removed in a future version. Use 'skip-token-revoke' instead.`
|
||||||
|
|
||||||
|
## main-custom-github-api-url.test.js
|
||||||
|
|
||||||
|
> stderr
|
||||||
|
|
||||||
|
''
|
||||||
|
|
||||||
|
> stdout
|
||||||
|
|
||||||
|
`owner and repositories set, creating token for repositories "actions/create-github-app-token" owned by "actions"␊
|
||||||
|
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
|
␊
|
||||||
|
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
|
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
|
␊
|
||||||
|
::set-output name=expiresAt::2016-07-11T22:14:10Z`
|
||||||
|
|
||||||
## main-missing-app-id.test.js
|
## main-missing-app-id.test.js
|
||||||
|
|
||||||
> stderr
|
> stderr
|
||||||
@@ -69,7 +85,9 @@ Generated by [AVA](https://avajs.dev).
|
|||||||
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
␊
|
␊
|
||||||
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a`
|
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
|
␊
|
||||||
|
::set-output name=expiresAt::2016-07-11T22:14:10Z`
|
||||||
|
|
||||||
## main-token-get-owner-set-repo-set-to-many.test.js
|
## main-token-get-owner-set-repo-set-to-many.test.js
|
||||||
|
|
||||||
@@ -83,7 +101,9 @@ Generated by [AVA](https://avajs.dev).
|
|||||||
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
␊
|
␊
|
||||||
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a`
|
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
|
␊
|
||||||
|
::set-output name=expiresAt::2016-07-11T22:14:10Z`
|
||||||
|
|
||||||
## main-token-get-owner-set-repo-set-to-one.test.js
|
## main-token-get-owner-set-repo-set-to-one.test.js
|
||||||
|
|
||||||
@@ -97,7 +117,9 @@ Generated by [AVA](https://avajs.dev).
|
|||||||
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
␊
|
␊
|
||||||
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a`
|
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
|
␊
|
||||||
|
::set-output name=expiresAt::2016-07-11T22:14:10Z`
|
||||||
|
|
||||||
## main-token-get-owner-set-to-org-repo-unset.test.js
|
## main-token-get-owner-set-to-org-repo-unset.test.js
|
||||||
|
|
||||||
@@ -111,7 +133,9 @@ Generated by [AVA](https://avajs.dev).
|
|||||||
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
␊
|
␊
|
||||||
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a`
|
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
|
␊
|
||||||
|
::set-output name=expiresAt::2016-07-11T22:14:10Z`
|
||||||
|
|
||||||
## main-token-get-owner-set-to-user-fail-response.test.js
|
## main-token-get-owner-set-to-user-fail-response.test.js
|
||||||
|
|
||||||
@@ -126,7 +150,9 @@ Generated by [AVA](https://avajs.dev).
|
|||||||
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
␊
|
␊
|
||||||
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a`
|
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
|
␊
|
||||||
|
::set-output name=expiresAt::2016-07-11T22:14:10Z`
|
||||||
|
|
||||||
## main-token-get-owner-set-to-user-repo-unset.test.js
|
## main-token-get-owner-set-to-user-repo-unset.test.js
|
||||||
|
|
||||||
@@ -140,7 +166,9 @@ Generated by [AVA](https://avajs.dev).
|
|||||||
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
␊
|
␊
|
||||||
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a`
|
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
|
␊
|
||||||
|
::set-output name=expiresAt::2016-07-11T22:14:10Z`
|
||||||
|
|
||||||
## main-token-get-owner-unset-repo-set.test.js
|
## main-token-get-owner-unset-repo-set.test.js
|
||||||
|
|
||||||
@@ -154,7 +182,9 @@ Generated by [AVA](https://avajs.dev).
|
|||||||
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
␊
|
␊
|
||||||
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a`
|
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
|
␊
|
||||||
|
::set-output name=expiresAt::2016-07-11T22:14:10Z`
|
||||||
|
|
||||||
## main-token-get-owner-unset-repo-unset.test.js
|
## main-token-get-owner-unset-repo-unset.test.js
|
||||||
|
|
||||||
@@ -168,7 +198,29 @@ Generated by [AVA](https://avajs.dev).
|
|||||||
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
::add-mask::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
␊
|
␊
|
||||||
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
::set-output name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a`
|
::save-state name=token::ghs_16C7e42F292c6912E7710c838347Ae178B4a␊
|
||||||
|
␊
|
||||||
|
::set-output name=expiresAt::2016-07-11T22:14:10Z`
|
||||||
|
|
||||||
|
## post-revoke-token-fail-response.test.js
|
||||||
|
|
||||||
|
> stderr
|
||||||
|
|
||||||
|
''
|
||||||
|
|
||||||
|
> stdout
|
||||||
|
|
||||||
|
'::warning::Token revocation failed: '
|
||||||
|
|
||||||
|
## post-token-expired.test.js
|
||||||
|
|
||||||
|
> stderr
|
||||||
|
|
||||||
|
''
|
||||||
|
|
||||||
|
> stdout
|
||||||
|
|
||||||
|
'Token expired, skipping token revocation'
|
||||||
|
|
||||||
## post-token-set.test.js
|
## post-token-set.test.js
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user