Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for GitHub app to use ephemeral tokens #519

Open
v1v opened this issue Dec 12, 2024 · 0 comments
Open

Support for GitHub app to use ephemeral tokens #519

v1v opened this issue Dec 12, 2024 · 0 comments

Comments

@v1v
Copy link

v1v commented Dec 12, 2024

If I use a GitHub app to create an Ephemeral GitHub token it's not working as expected

{
  "level": "info",
  "message": "Backporting options",
  "metadata": {
    "accessToken": "<REDACTED>",
    "assignees": [],
    "authenticatedUsername": "my-github-app[bot]",
    "author": "my-github-app[bot]",
    "autoAssign": false,
    "autoMerge": false,
    "autoMergeMethod": "merge",
    "backportBinary": "backport",
    "cherrypickRef": true,
    "commitConflicts": true,
    "commitPaths": [],
    "copySourcePRLabels": false,
    "copySourcePRReviewers": false,
    "cwd": "/home/runner/work/observability-robots-playground/observability-robots-playground",
    "dateSince": null,
    "dateUntil": null,
    "details": false,
    "draft": false,
    "fork": true,
    "gitHostname": "github.com",
    "interactive": false,
    "isRepoPrivate": true,
    "maxNumber": 10,
    "multipleBranches": true,
    "multipleCommits": false,
    "noVerify": true,
    "prDescription": "{defaultPrDescription} PRs are backported even if there are merge conflicts, please review them.",
    "publishStatusCommentOnAbort": false,
    "publishStatusCommentOnFailure": false,
    "publishStatusCommentOnSuccess": true,
    "pullNumber": 173,
    "repoForkOwner": "my-github-app[bot]",
    "repoName": "observability-robots-playground",
    "repoOwner": "my-org",
    "resetAuthor": false,
    "reviewers": [],
    "signoff": false,
    "sourceBranch": "main",
    "sourcePRLabels": [],
    "targetBranchChoices": [],
    "targetBranches": [
      "8.17"
    ],
    "targetPRLabels": [],
    "telemetry": true
  },
  "timestamp": "2024-12-12 14:51:34"
}

Then it uses my-github-app[bot]

{"level":"info","message":"Running command: \"git remote rm my-github-app[bot]\"","metadata":{},"timestamp":"2024-12-12 14:51:35"}

And it fails

{
  "level": "info",
  "message": "Running command: \"git push my-github-app[bot] backport/8.17/pr-173:backport/8.17/pr-173 --force\"",
  "metadata": {},
  "timestamp": "2024-12-12 14:51:37"
}

{
  "level": "error",
  "message": "runSequentially failed Code: 128, Args: \"push my-github-app[bot] backport/8.17/pr-173:backport/8.17/pr-173 --force\", Message: fatal: 'my-github-app[bot]' does not appear to be a git repository\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.",
  "metadata": {
    "context": {
      "cmdArgs": [
        "push",
        "my-github-app[bot]",
        "backport/8.17/pr-173:backport/8.17/pr-173",
        "--force"
      ],
      "code": 128,
      "stderr": "fatal: 'my-github-app[bot]' does not appear to be a git repository\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n",
      "stdout": ""
    },
    "name": "SpawnError",
    "stack": "SpawnError: Code: 128, Args: \"push my-github-app[bot] backport/8.17/pr-173:backport/8.17/pr-173 --force\", Message: fatal: 'my-github-app[bot]' does not appear to be a git repository\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/backport/dist/lib/child-process-promisified.js:53:29)\n    at ChildProcess.emit (node:events:517:28)\n    at maybeClose (node:internal/child_process:1098:16)\n    at ChildProcess._handle.onexit (node:internal/child_process:303:5)\n    at Process.callbackTrampoline (node:internal/async_hooks:128:17)"
  },
  "timestamp": "2024-12-12 14:51:37"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant