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

Token not being sent to GitHub's domain #204

Closed
khurrambilalaurecon opened this issue Jan 11, 2023 · 3 comments · Fixed by #283
Closed

Token not being sent to GitHub's domain #204

khurrambilalaurecon opened this issue Jan 11, 2023 · 3 comments · Fixed by #283
Assignees
Labels
status: pinned Should not be labeled as stale type: bug Verified problems that need to be worked on

Comments

@khurrambilalaurecon
Copy link

Hello,
I'm trying to use the action but it throws the error even though i'm providing the path to the file (file url and file name as well).
My "package,json" file resides in "./client/package.json". I want to compare the version from local package.json against the release branch package.json file.

Error logs >>>
Run EndBug/version-check@v[2]
with:
diff-search: true
file-url: https://raw.githubusercontent.com/owner/my-repo/release/client/package.json
file-name: /client/package.json
token: ***
static-checking: localIsNew
github-api-url: https://api.github.com
Searching for version update...
Static-checking files...
Package file name: "/client/package.json"
Package file URL: "https://raw.githubusercontent.com/owner/my-repo/release/client/package.json"
Error: Response code :404 (Not Found)

Here is the workflow file:

steps:
- name: Check out repository
  uses: actions/checkout@v2

- name: Package.json version check
  id: check
  uses: EndBug/version-check@v2
  with:
    diff-search: true
    file-url: https://raw.githubusercontent.com/${{ github.repository }}/${{ github.base_ref }}/client/package.json
    file-name: /client/package.json
    token: ${{ secrets.GITHUB_TOKEN }}
    static-checking: localIsNew

- name: Echo versions
  run: |
      echo "Version change found in commit ${{ steps.check.outputs.commit }}! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"

- name: Version Bump check enforced
  shell: pwsh
  if: steps.check.outputs.changed == 'false'
  run: |
    echo "No version change :/"
    echo "Please bump the application version before merging into release"
    exit 1
- name: Version bumped
  shell: pwsh
  if: steps.check.outputs.changed == 'true'
  run: |
    echo "Version bumped! Enjoy the new release :)"
@khurrambilalaurecon khurrambilalaurecon added the type: question Further information is requested label Jan 11, 2023
@EndBug
Copy link
Owner

EndBug commented Jan 11, 2023

Oh ok, I get why this is happening

As of now, the action uses the token only when the before tag is used for the file-url input, in order to prevent sending the token to other websites.
I guess I should also check whether the URL domain is GitHub's

Ref: a9162ce

@EndBug EndBug self-assigned this Jan 11, 2023
@EndBug EndBug added type: bug Verified problems that need to be worked on status: pinned Should not be labeled as stale and removed type: question Further information is requested labels Jan 11, 2023
@EndBug EndBug changed the title Response code 404 (package.json not found) Token not being sent to GitHub's domain Jan 11, 2023
@EndBug EndBug linked a pull request Oct 2, 2024 that will close this issue
@EndBug
Copy link
Owner

EndBug commented Oct 2, 2024

@all-contributors please add @khurrambilalaurecon for their bug contribution

Copy link
Contributor

@EndBug

I've put up a pull request to add @khurrambilalaurecon! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: pinned Should not be labeled as stale type: bug Verified problems that need to be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants