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

Proxies not working when proxy IP is an internal network #904

Open
vmorales-2920 opened this issue Aug 20, 2024 · 2 comments
Open

Proxies not working when proxy IP is an internal network #904

vmorales-2920 opened this issue Aug 20, 2024 · 2 comments

Comments

@vmorales-2920
Copy link

vmorales-2920 commented Aug 20, 2024

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

@travi
Copy link
Member

travi commented Aug 21, 2024

this does not appear to be a problem with the use of your proxy by semantic-release. as the error returned by github describes, it appears that the proxy you are routing your request through is not in the list of allowed IPs configured by your company to access github. see https://docs.github.com/en/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization for more detail

@vmorales-2920
Copy link
Author

Could also be the issue that the proxy is being ignored when the request is made?

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

2 participants