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

Skip git altogether #8

Closed
5 tasks done
rarkins opened this issue Dec 18, 2016 · 7 comments
Closed
5 tasks done

Skip git altogether #8

rarkins opened this issue Dec 18, 2016 · 7 comments

Comments

@rarkins
Copy link
Collaborator

rarkins commented Dec 18, 2016

Is it possible to do all the git options via the GitHub API instead?

@rarkins
Copy link
Collaborator Author

rarkins commented Dec 19, 2016

https://api.github.com/repos/singapore/package-test/contents/package.json seems to return the package.json in base64 format, but when I copy/paste the "content" field into online decoders, it seems to have a character problem.

The response also includes a "download_url" field which works (gives the raw file).

@rarkins
Copy link
Collaborator Author

rarkins commented Dec 19, 2016

Adding Accept: application/vnd.github.VERSION.raw header gets you the raw file!

@rarkins
Copy link
Collaborator Author

rarkins commented Dec 19, 2016

A URL like https://api.github.com/repos/singapore/package-test/contents/package.json?ref=upgrade/angular will get the package.json from branch "upgrade/angular". If the branch/file doesn't exist then you get a response like:

{
  "message": "No commit found for the ref upgrade/angular2",
  "documentation_url": "https://developer.github.com/v3/repos/contents/"
}

@rarkins
Copy link
Collaborator Author

rarkins commented Dec 19, 2016

The master SHA can be found with this URL: https://api.github.com/repos/singapore/package-test/commits/master

@rarkins
Copy link
Collaborator Author

rarkins commented Dec 19, 2016

Create a branch. Use https://api.github.com/repos/singapore/package-test/git/refs. Response is:

{
  "ref": "refs/heads/testtest1",
  "url": "https://api.github.com/repos/singapore/package-test/git/refs/heads/testtest1",
  "object": {
    "sha": "61fe1c4451cf22df5c84f9b0b6876f7214c476ce",
    "type": "commit",
    "url": "https://api.github.com/repos/singapore/package-test/git/commits/61fe1c4451cf22df5c84f9b0b6876f7214c476ce"
  }
}

@rarkins
Copy link
Collaborator Author

rarkins commented Dec 19, 2016

Get the SHA of package.json for branch testtest1: https://api.github.com/repos/singapore/package-test/contents/package.json?ref=testtest1

9e7c115f680cfdeb0822fec8be35aa8cb2e9f920

@rarkins
Copy link
Collaborator Author

rarkins commented Dec 19, 2016

Updating package.json in a branch also worked.

URL: https://api.github.com/repos/singapore/package-test/contents/package.json

Body:

{
	"branch": "testtest1",
  "message": "update from API",
  "author": {
    "name": "Renovate Bot",
    "email": "renovate-bot@keylocation.sg"
  },
  "content": "ew0KICAibmFtZSI6ICJjbGllbnQtYnVpbGQiLA0KICAiZGVzY3JpcHRpb24iOiAiQ2xpZW50IG5vZGUgbW9kdWxlcyBmb3Iga2V5bG9jYXRpb24iLA0KICAidmVyc2lvbiI6ICIxLjAuMCIsDQogICJhdXRob3IiOiAiUmh5cyBBcmtpbnMgPHJoeXNAa2V5bG9jYXRpb24uc2c+IiwNCiAgImJ1Z3MiOiAiaHR0cHM6Ly9naXRodWIuY29tL3NpbmdhcG9yZS9rZXlsb2NhdGlvbi9pc3N1ZXMiLA0KICAiY29udHJpYnV0b3JzIjogWw0KICAgIHsNCiAgICAgICJuYW1lIjogIlJoeXMgQXJraW5zIg0KICAgIH0sDQogICAgew0KICAgICAgIm5hbWUiOiAiQXlvdWIgS2FhbmljaCINCiAgICB9DQogIF0sDQogICJkZXBlbmRlbmNpZXMiOiB7DQogICAgImF1dG9wcmVmaXhlciI6ICI2LjUuMCIsDQogICAgImJvd2VyIjogIjEuNy43IiwNCiAgICAiYnJvd3NlcmlmeSI6ICIxMy4xLjAiLA0KICAgICJicm93c2VyaWZ5LWNzcyI6ICIwLjkuMiIsDQogICAgImNoZWVyaW8iOiAiMC4yMi4wIiwNCiAgICAiY29uZmlnIjogIjEuMjEuMCIsDQogICAgImNzcy1sb2FkZXIiOiAiMC4yNS4wIiwNCiAgICAiZGF0YXVyaSI6ICIxLjAuNCIsDQogICAgImV4cG9ydHMtbG9hZGVyIjogIjAuNi4zIiwNCiAgICAiZXh0cmFjdC10ZXh0LXdlYnBhY2stcGx1Z2luIjogIjEuMC4xIiwNCiAgICAiZmlsZS1sb2FkZX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ogIjIuMTcuMSIsDQogICAgIm5nLWFubm90YXRlIjogIjEuMi4xIiwNCiAgICAibmctaW5maW5pdGUtc2Nyb2xsIjogIjEuMy4wIiwNCiAgICAibmctdG9hc3QiOiAiMi4wLjAiLA0KICAgICJub3Vpc2xpZGVyIjogIjkuMC4wIiwNCiAgICAibm91aXNsaWRlci1hbmd1bGFyIjogIjIuNi4yIiwNCiAgICAib2RvbWV0ZXIiOiAiMC40LjciLA0KICAgICJvdWlib3VuY2UiOiAiMC4wLjEyIiwNCiAgICAicHJvbWlzZS1wb2x5ZmlsbCI6ICI2LjAuMiIsDQogICAgInEiOiAiMS40LjEiLA0KICAgICJyYXZlbi1qcyI6ICIzLjkuMSIsDQogICAgInNwaW4uanMiOiAiMi4zLjIiLA0KICAgICJzcGxpdC5qcyI6ICIxLjEuMSIsDQogICAgInN2Z3h1c2UiOiAiMS4xLjIzIiwNCiAgICAidGV0aGVyLXNoZXBoZXJkIjogIjEuOC4xIiwNCiAgICAidWktc2VsZWN0IjogIjAuMTkuNiINCiAgfSwNCiAgImhvbWVwYWdlIjogImh0dHBzOi8va2V5bG9jYXRpb24uc2ciLA0KICAia2V5d29yZHMiOiBbDQogICAgIktleSBMb2NhdGlvbiIsDQogICAgIlNpbmdhcG9yZSINCiAgXSwNCiAgImxpY2Vuc2UiOiAiUHJvcHJpZXRhcnkgYW5kIENvbmZpZGVudGlhbCIsDQogICJwcml2YXRlIjogdHJ1ZSwNCiAgInJlcG9zaXRvcnkiOiB7DQogICAgInR5cGUiOiAiZ2l0IiwNCiAgICAidXJsIjogImh0dHA6Ly9naXRodWIuY29tL3NpbmdhcG9yZS9rZXlsb2NhdGlvbi5naXQiDQogIH0NCn0=",
  "sha": "fb617c9e42866ca24d0ff8e0c2725048f6f9530c"
}

@rarkins rarkins closed this as completed Dec 20, 2016
rarkins added a commit that referenced this issue Jan 4, 2017
Closes #8, Closes #1

commit 02eefd2ec70bf8a07e667d13a4e33dc70dd9db96
Author: Rhys Arkins <rhys@keylocation.sg>
Date:   Wed Jan 4 18:25:30 2017 +0100

    Refactor updates

commit e9330e41a3388879ef300f40d8843210c70e2b31
Author: Rhys Arkins <rhys@keylocation.sg>
Date:   Wed Jan 4 18:25:17 2017 +0100

    Improve commenting

commit 2feb32f218a83ec765732280af8b0d9e569fb313
Author: Rhys Arkins <rhys@keylocation.sg>
Date:   Wed Jan 4 13:34:36 2017 +0100

    Refactor token input

commit 28b4428bae8cdafffe0227e794e8f77a5be2fcfd
Author: Rhys Arkins <rhys@keylocation.sg>
Date:   Wed Jan 4 13:28:09 2017 +0100

    Rename files

commit 2fe98be1b31b27f625023ffb748f36c3a0eefee6
Author: Rhys Arkins <rhys@keylocation.sg>
Date:   Wed Jan 4 13:21:52 2017 +0100

    Improve error log

commit e6f0e691945e561c458147f52b02903ba82373d7
Author: Rhys Arkins <rhys@keylocation.sg>
Date:   Mon Dec 19 19:20:53 2016 +0100

    Support custom package.json path

commit 5f971746d3abe2a40b94cae3b8592ec97b21358e
Author: Rhys Arkins <rhys@keylocation.sg>
Date:   Mon Dec 19 19:20:40 2016 +0100

    Handle null dependencies or devDependencies

commit 9eac59859626bc7d40cacb1e93e645973667208c
Author: Rhys Arkins <rhys@keylocation.sg>
Date:   Mon Dec 19 18:23:14 2016 +0100

    Split per branch

commit 61d7337e813b86d186511fdb6ad0655b6110942f
Author: Rhys Arkins <rhys@keylocation.sg>
Date:   Mon Dec 19 18:22:59 2016 +0100

    Ignore unstable

commit d4d8bcf0895046b5d13f8dea93dbb30121f9be7c
Author: Rhys Arkins <rhys@keylocation.sg>
Date:   Mon Dec 19 18:22:10 2016 +0100

    Pin

commit 4b9306b8072726b2eed74a0f56a4687c865539a4
Author: Rhys Arkins <rhys@keylocation.sg>
Date:   Mon Dec 19 11:55:47 2016 +0100

    Add new
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant