semantic-release / semantic-release/github

Proxies not working when proxy IP is an internal network

Open
#904 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
534
Forks
150
Avg merge
1m
Merged PRs (30d)
3

Description

I have a repository inside a corporate network, I made a GitHub workflow to use semantic release but it fails due to proxies.
I already setup the proxies but issue persist.

semantic configuration in package.json:
"release": {
        "branches": [
            "main"
        ],
        "repositoryUrl": "https://github.com/xxxx/xxxxx.git",
        "plugins": [
            "@semantic-release/commit-analyzer",
            "@semantic-release/release-notes-generator",
            "@semantic-release/changelog",
            [
                "@semantic-release/github",
                {
                    "proxy": {
                        "host": "xxxx",
                        "port": xxxx,
                        "secureProxy": true
                    }
                }
            ],
            [
                "@semantic-release/git",
                {
                    "assets": [
                        "package.json",
                        "CHANGELOG.md"
                    ],
                    "message": "chore(release): ${nextRelease.version} \n\n${nextRelease.notes}"
                }
            ]
        ]
    },
release.yml
name: Release

on:
  push:
    branches:
      - main

jobs:
  release:
    runs-on: ["xxxxxx"]
      
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: "lts/*"

      - name: Install dependencies
        run: npm install

      - name: Run release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: npx semantic-release
error:
Run npx semantic-release
  
[8:52:29 PM] [semantic-release] › ℹ  Running semantic-release version 24.1.0
[8:52:29 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/changelog"
[[8](https://github.com/xxxx/xxxx/actions/runs/10479003669/job/29023655288#step:7:9):52:29 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/github"
[8:52:2[9](https://github.com/xxxx/xxxx/actions/runs/10479003669/job/29023655288#step:7:10) PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/git"
[8:52:29 PM] [semantic-release] › ✔  Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
[8:52:29 PM] [semantic-release] › ✔  Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
[8:52:29 PM] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/changelog"
[8:52:29 PM] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/git"
[8:52:29 PM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/github"
[8:52:29 PM] [semantic-release] › ✔  Loaded plugin "addChannel" from "@semantic-release/github"
[8:52:29 PM] [semantic-release] › ✔  Loaded plugin "success" from "@semantic-release/github"
[8:52:29 PM] [semantic-release] › ✔  Loaded plugin "fail" from "@semantic-release/github"
[8:52:31 PM] [semantic-release] › ✔  Run automated release from branch main on repository https://github.com/xxxx/xxxx.git
[8:52:31 PM] [semantic-release] › ✔  Allowed to push to the Git repository
[8:52:31 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/changelog"
[8:52:31 PM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/changelog"
[8:52:31 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/github"
[8:52:31 PM] [semantic-release] [@semantic-release/github] › ℹ  Verify GitHub authentication (https://api.github.com/)
[8:52:32 PM] [semantic-release] › ✘  Failed step "verifyConditions" of plugin "@semantic-release/github"
[8:52:32 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/git"
[8:52:32 PM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/git"
[8:52:32 PM] [semantic-release] › ✘  An error occurred while running semantic-release: RequestError [HttpError]: Although you appear to have the correct authorization credentials, the `xxxx` organization has an IP allow list enabled, and your IP address is not permitted to access this resource. - https://docs.github.com/rest/repos/repos#get-a-repository

response: {
    url: 'https://api.github.com/repos/xxxx/xxxx',
    status: 403,
    headers: {
      'access-control-allow-origin': '*',
      'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset',
      'content-encoding': 'gzip',
      'content-security-policy': "default-src 'none'",
      'content-type': 'application/json; charset=utf-8',
      date: 'Tue, 20 Aug 2024 20:52:32 GMT',
      'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
      server: 'github.com',
      'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
      'transfer-encoding': 'chunked',
      vary: 'Accept-Encoding, Accept, X-Requested-With',
      'x-accepted-github-permissions': 'metadata=read',
      'x-content-type-options': 'nosniff',
      'x-frame-options': 'deny',
      'x-github-api-version-selected': '2022-11-28',
      'x-github-media-type': 'github.v3; format=json',
      'x-github-request-id': 'AE59:2608A9:1BBE627:358A145:66C50210',
      'x-ratelimit-limit': '15000',
      'x-ratelimit-remaining': '1[49](https://github.com/xxxx/xxxxh/actions/runs/10479003669/job/29023655288#step:7:50)76',
      'x-ratelimit-reset': '1724188[50](https://github.com/xxxx/xxxx/actions/runs/10479003669/job/29023655288#step:7:51)8',
      'x-ratelimit-resource': 'core',
      'x-ratelimit-used': '24',
      'x-xss-protection': '0'
    },
    data: {
      message: 'Although you appear to have the correct authorization credentials, the `xxxx` organization has an IP allow list enabled, and your IP address is not permitted to access this resource.',
      documentation_url: 'https://docs.github.com/rest/repos/repos#get-a-repository',
      status: '403'
    }
  },
  pluginName: '@semantic-release/github'
semantic version

^24.0.0

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the @semantic-release/github verifyConditions step and its GitHub API request, using the package.json proxy configuration and release.yml workflow shown here. Reproduce the workflow against the internal proxy and determine whether the request reaches GitHub from an allowed IP; done means the plugin can authenticate successfully without the reported 403 response.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.